The notion of static methods that are used in QML differs somewhat from the classical one in C ++, when static methods are created in the class that can be used referring to the class name, rather than to a specific object. In the case of QML, things are somewhat different. In order to use such methods in QML, which are present in the C ++ class, it is necessary to register a Singleton object that will provide the required methods, and these methods should no longer be static in themselves. They should at least be labeled with the
macro so that they can be used in QML.
, you need to use the
function, which in addition to the standard parameters that are passed to qmlRegisterType, you must also pass the static
function, which you also write yourself.