expected body of lambda expression
Solved
QML and Qt Quick
-
Hi,
I'm working in integrating QML and C++ by applying this example but the parser says (unable to build the project too):
error: expected body of lambda expression // points to emit [ emit] userNameChanged();
Although I already included
CONFIG += c++11
in my.pro
file!How can I fix this issue?
- OS: Linux Mint 19.1 xfce
- GCC: gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
- G++: g++ (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
-
Hi
Can you show the actual code that gives this error?
Looking at samplevoid BackEnd::setUserName(const QString &userName) { if (userName == m_userName) return; m_userName = userName; emit userNameChanged(); }
I see no lambdas or any cause for such error.
-
@tansgumus
ah, so the [] part was left and
it missed the actual body ? ( {})
Well these things happens :)