c++ - Providing Q_PROPERTY in subclass of Q_OBJECT result in Error 1 -
i need solving following problem:
i have base class, derives qobject , has q_object
macro. in class want subclass base class , provide properties use in qml (q_property
).
but seems missing basic piece of information, because cannot going
baseclass:
#ifndef a_h #define a_h #include <qobject> class a: public qobject { q_object q_property(qstring name read getname constant) ...
subclass:
#ifndef b_h #define b_h #include "classpath/a.h" class b: public { q_object q_property(qstring type read gettype write settype notify typechanged) ...
furthermore have registered type qml qmlregistertype<b>("customclasses",1,0,"b");
in qml file creating b item b{ type: "b" }
the error following: [debug/moc_b.cpp] error 1
not informative me , qt knowings
if remove q_object
macro geht cannot assign non-existent property type
i hope 1 of can explain im doing wrong!
thanks in advance!
thanks hints! figured out forgot putvoid typechanged()
under signals:
pretty trivial in retrospect
thanks @ manni66! had no idea there more detailed compiler output in ide. led me correct solution.
Comments
Post a Comment