How to use a specialization of an C++ interface?
Solved
QML and Qt Quick
-
wrote on 27 May 2017, 13:32 last edited by
Very straight forward case, I register like:
qmlRegisterUncreatableType<InputDeviceConfiguratorGate>( "InputDeviceConfiguratorGate", 1, 0, "InputDeviceConfiguratorGate", "Not creatable in Qml." ); qmlRegisterUncreatableType<JoystickDeviceConfigurator>( "JoystickDeviceConfigurator", 1, 0, "JoystickDeviceConfigurator", "Not creatable in Qml." );
JoystickDeviceConfigurator is derived publicly from InputDeviceConfiguratorGate.
At runtime I get the following error:
QMetaType::registerTypedef: -- Type name 'InputDeviceConfiguratorGate*' previously registered as typedef of 'InputDeviceConfiguratorGate*' [1049], now registering as typedef of 'JoystickDeviceConfigurator*' [1051].
I actually would like to have InputDeviceConfiguratorGate registered as interface. The question was asked
here. -
Very straight forward case, I register like:
qmlRegisterUncreatableType<InputDeviceConfiguratorGate>( "InputDeviceConfiguratorGate", 1, 0, "InputDeviceConfiguratorGate", "Not creatable in Qml." ); qmlRegisterUncreatableType<JoystickDeviceConfigurator>( "JoystickDeviceConfigurator", 1, 0, "JoystickDeviceConfigurator", "Not creatable in Qml." );
JoystickDeviceConfigurator is derived publicly from InputDeviceConfiguratorGate.
At runtime I get the following error:
QMetaType::registerTypedef: -- Type name 'InputDeviceConfiguratorGate*' previously registered as typedef of 'InputDeviceConfiguratorGate*' [1049], now registering as typedef of 'JoystickDeviceConfigurator*' [1051].
I actually would like to have InputDeviceConfiguratorGate registered as interface. The question was asked
here.wrote on 28 May 2017, 19:43 last edited by@c64zottel Ok, I figured it out. My mistake is a missing Q_OBJECT declaration in the JoystickDeviceConfigurator:
class JoystickDeviceConfigurator : public InputDeviceConfiguratorGate { Q_OBJECT public:
1/2