Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How QObject got notified when children add in
jiangcaiyang last edited by
Consider this qml file:
@CustomObject// inherts from QtObject
When instancing this qml script, how can "parent" got notified when "child_1" become its child? I want to make some connections in C++ code, to do a little extra things.
CustomObject is well defined in C++ and exported to QML environment.
andre last edited by
Events are used for that.
Reimplement bool QObject::childEvent(QChildEvent* e); and do your magic :)