Today I've faced strange bug in our program. The object of a class inherited from QObject
was being deleted by event with type QEvent::DefferedDelete
, while nobody could possibly send it.
It was passed into QML as QVariant:
// cpp:
Q_INVOKABLE QVariant currentDevice_v() const {
return QVariant::fromValue(_current);
}
// qml:
Component.onCompleted: {
curDevice = devicesModel.currentDevice_v()
#...
}
Without that qml line everything worked well - nothing produces delete event.