From 5692e039ee7ab2f8baeb87ae1a50b33c5558206f Mon Sep 17 00:00:00 2001 From: reionwong Date: Tue, 31 Aug 2021 01:43:59 +0800 Subject: [PATCH] Update main.cpp --- src/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 88220db..8afbe26 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -40,12 +40,17 @@ int main(int argc, char *argv[]) QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QByteArray uri = "Cutefish.Launcher"; - qmlRegisterAnonymousType(uri, 1); qmlRegisterUncreatableType(uri, 1, 0, "LauncherItem", "cannot init application"); qmlRegisterType(uri, 1, 0, "LauncherModel"); qmlRegisterType(uri, 1, 0, "PageModel"); qmlRegisterType(uri, 1, 0, "IconItem"); +#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) + qmlRegisterType(); +#else + qmlRegisterAnonymousType(uri, 0); +#endif + QApplication app(argc, argv); app.setApplicationName(QStringLiteral("cutefish-launcher"));