diff options
author | Bernd Weimer <bernd.weimer@pelagicore.com> | 2019-08-28 10:52:49 +0200 |
---|---|---|
committer | Bernd Weimer <bernd.weimer@pelagicore.com> | 2019-11-11 17:34:48 +0100 |
commit | 8e46d6738c8335b9983fa365dfc684d4edb606c2 (patch) | |
tree | d6f869d0bb542697a3f7f5a9c927de32c857f623 /examples/applicationmanager/application-features/native | |
parent | 967a522cde2f37a8648c7e5492f19e657db08c29 (diff) |
Separate LauncherMain from Q*Application
This allows native applications to use LauncherMain and still choose
the application typ, e.g. QApplication for a native widget
application.
Task-number: AUTOSUITE-1260
Change-Id: Id5f643ebc1a9e413ed6f9b8cf8b3259fa0448859
Reviewed-by: Robert Griebl <robert.griebl@qt.io>
Diffstat (limited to 'examples/applicationmanager/application-features/native')
-rw-r--r-- | examples/applicationmanager/application-features/native/widgets/main.cpp | 20 | ||||
-rw-r--r-- | examples/applicationmanager/application-features/native/widgets/widgets.pro | 2 |
2 files changed, 15 insertions, 7 deletions
diff --git a/examples/applicationmanager/application-features/native/widgets/main.cpp b/examples/applicationmanager/application-features/native/widgets/main.cpp index f6a9b326..3403065f 100644 --- a/examples/applicationmanager/application-features/native/widgets/main.cpp +++ b/examples/applicationmanager/application-features/native/widgets/main.cpp @@ -29,15 +29,23 @@ #include <QApplication> #include <QPushButton> #include <QDialog> -#include "private/waylandqtamclientextension_p.h" -QT_USE_NAMESPACE_AM +#include "launchermain.h" +#include "logging.h" + int main(int argc, char *argv[]) { + QtAM::Logging::initialize(argc, argv); + + QtAM::LauncherMain::initialize(); QApplication app(argc, argv); + QtAM::LauncherMain launcher; - WaylandQtAMClientExtension waylandExtension; + launcher.registerWaylandExtensions(); + launcher.loadConfiguration(); + launcher.setupDBusConnections(); + launcher.setupLogging(false, launcher.loggingRules(), QString(), launcher.useAMConsoleLogger()); QPushButton window("I'm a top-level window!\nClick to open/close a popup."); QDialog *popup = new QDialog(&window); @@ -46,12 +54,12 @@ int main(int argc, char *argv[]) window.setStyleSheet("QPushButton { background-color : lightgrey; font-size: 36px; }"); popup->setStyleSheet("QPushButton { background-color : green; color : white; font-size: 24px; }"); - QObject::connect(&window, &QPushButton::clicked, [&popup, &waylandExtension] () { + QObject::connect(&window, &QPushButton::clicked, [&popup, &launcher] () { popup->setVisible(!popup->isVisible()); - waylandExtension.setWindowProperty(popup->windowHandle(), - "type", QVariant::fromValue(QStringLiteral("pop-up"))); + launcher.setWindowProperty(popup->windowHandle(), "type", QVariant::fromValue(QStringLiteral("pop-up"))); }); + app.processEvents(); window.showNormal(); return app.exec(); diff --git a/examples/applicationmanager/application-features/native/widgets/widgets.pro b/examples/applicationmanager/application-features/native/widgets/widgets.pro index f5ad0e66..589c1ab1 100644 --- a/examples/applicationmanager/application-features/native/widgets/widgets.pro +++ b/examples/applicationmanager/application-features/native/widgets/widgets.pro @@ -1,6 +1,6 @@ TEMPLATE = app CONFIG += install_ok -QT += widgets appman_launcher-private +QT += widgets appman_launcher-private appman_common-private SOURCES = main.cpp |