diff --git a/src/FluentUI.cpp b/src/FluentUI.cpp index ed5e6c6a..409a2aa4 100644 --- a/src/FluentUI.cpp +++ b/src/FluentUI.cpp @@ -20,20 +20,6 @@ #include "FluNetwork.h" #include "QRCode.h" -int major = 1; -int minor = 0; -auto uri = "FluentUI"; - -FluentUI* FluentUI::m_instance = nullptr; - -FluentUI *FluentUI::getInstance() -{ - if(FluentUI::m_instance == nullptr){ - FluentUI::m_instance = new FluentUI; - } - return FluentUI::m_instance; -} - void FluentUI::registerTypes(QQmlEngine *engine){ initializeEngine(engine,uri); registerTypes(uri); diff --git a/src/FluentUI.h b/src/FluentUI.h index ba6654f8..a8fa2b25 100644 --- a/src/FluentUI.h +++ b/src/FluentUI.h @@ -3,17 +3,20 @@ #include #include +#include "singleton.h" class FluentUI : public QObject { Q_OBJECT public: - static FluentUI *getInstance(); + SINGLETONG(FluentUI) Q_DECL_EXPORT void registerTypes(QQmlEngine *engine); void registerTypes(const char *uri); void initializeEngine(QQmlEngine *engine, const char *uri); private: - static FluentUI* m_instance; + const int major = 1; + const int minor = 0; + const char *uri = "FluentUI"; }; #endif // FLUENTUI_H