How qml call static method from c++
问题 What I done: validator.h: class UTILSSHARED_EXPORT Validator: public QObject { Q_OBJECT public: Validator(QObject *parent = 0); ~Validator(); Q_INVOKABLE static bool validateMobile(const QString target); }; main.cpp: qmlRegisterUncreatableType<Validator>("CT.Utils", 1, 0, "ValidatorKit", "It just a kit"); qml: import CT.Utils 1.0 ValidatorKit.validateMobile("112344") But unfortunately, I got an error that said: TypeError: Property 'validateMobile' of object [object Object] is not a function