[SOLVED] ERROR: "invalid application of ‘sizeof’ ... " with Q_OBJECT
-
wrote on 19 Jan 2014, 21:30 last edited by
Hello community!
Part of my problem is very similar to "Diagram Scene Example" (http://qt-project.org/doc/qt-5/qtwidgets-graphicsview-diagramscene-example.html, and I decided to take it as a basis.
However, I encountered a problem.
The fact is that I would like to use signals in the class "DiagramItem", as is done in class "DiagramTextItem",
but when I add 'Q_OBJECT' I get an error:
"invalid application of 'sizeof' to incomplete type 'QStaticAssertFailure<false>'
enum {Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, COUNTER) = sizeof(QStaticAssertFailure<!!(Condition)>)} "QT 5.2
Thanks in advance for any help
-
Hi and welcome to devnet,
DiagarmItem doesn't inherit from QObject so you can't just add that macro. You need to also inherit from it
-
wrote on 19 Jan 2014, 22:28 last edited by
Thank you! Now it works!
-
You're welcome !
Happy coding !
2/4