Commit f38859e4 authored by Nicolas Fella's avatar Nicolas Fella

Use QApplication on linux

parent b44fb3d9
......@@ -12,10 +12,12 @@ include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
find_package(Qt5 REQUIRED COMPONENTS Gui Qml Widgets)
find_package(Qt5 REQUIRED COMPONENTS Gui Qml)
if (ANDROID)
find_package(Qt5 REQUIRED COMPONENTS AndroidExtras)
else()
find_package(Qt5 REQUIRED COMPONENTS Widgets)
endif()
find_package(KPublicTransport REQUIRED)
......
......@@ -14,6 +14,8 @@ target_link_libraries(ktrip Qt5::Qml Qt5::Gui KPublicTransport)
if (ANDROID)
target_link_libraries(ktrip Qt5::AndroidExtras)
else()
target_link_libraries(ktrip Qt5::Widgets)
endif()
install(TARGETS ktrip ${INSTALL_TARGETS_DEFAULT_ARGS})
......
#ifdef Q_OS_ANDROID
#include <QGuiApplication>
#else
#include <QApplication>
#endif
#include <QQmlApplicationEngine>
#include <QQmlContext>
......@@ -14,7 +19,13 @@ Q_DECL_EXPORT
#endif
int main(int argc, char *argv[])
{
#ifdef Q_OS_ANDROID
QGuiApplication app(argc, argv);
#else
QApplication app(argc, argv);
#endif
QQmlApplicationEngine engine(QUrl(QStringLiteral("qrc:/qml/main.qml")));
qmlRegisterType<LocationQueryModel>("org.kde.ktrip", 0, 1, "LocationQueryModel");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment