11-21-2012 01:03 PM
I want to use a custom class in a qml signal, but have difficulties implementing that correctly.
My class is OutgoingInputs
I call
qRegisterMetaType<OutgoingInputs*>("OutgoingInputs ");
to register a pointer to it as a meta type, which seems to be needed, but when i also use
Q_DECLARE_METATYPE(OutgoingInputs*)
in the header file of the class i get a compile error.
Do I have to register it without a pointer (got the idea from here ) or is there some other obvious error?
Is there an example how to do that?
I can receive the signal if my slot does not use any parameters.
Solved! Go to Solution.
11-22-2012 09:17 PM
i don't think you need to register as metatype....a simple register should do it as it is the same as using the object in QML:
qmlRegisterType<OutgoingInputs>("mynamespace",1,0,"OutgoingInputs");
found this on the qt forums:
http://qt-project.org/forums/viewthread/9657
hope it helps!
11-26-2012 08:30 AM