Nominate our 2022 Qt Champions!

How to use a virtual interface in Qml with qmlRegisterInterface?

  • The documentation is kind of sparse in this area:

    I tried to register my Interface like this:

    qmlRegisterInterface<InputDeviceConfigurator>( "InputDeviceConfigurator" );

    But I can not import it because there is no version number and just using it out of the blue gives the "is not a type" error.

    If I declare the type as follows:

                "InputDeviceConfigurator", 1, 0, "InputDeviceConfigurator", "Not creatable in Qml." );

    It works just fine.

    So, what do I not understand with qmlRegisterInterface?

Log in to reply