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 | |
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')
5 files changed, 17 insertions, 9 deletions
diff --git a/examples/applicationmanager/application-features/apps/twins/twins.qml b/examples/applicationmanager/application-features/apps/twins/twins.qml index 29416973..09134efc 100644 --- a/examples/applicationmanager/application-features/apps/twins/twins.qml +++ b/examples/applicationmanager/application-features/apps/twins/twins.qml @@ -80,6 +80,7 @@ QtObject { ApplicationManagerWindow { id: popup + width: 300; height: 100 Rectangle { anchors.fill: parent diff --git a/examples/applicationmanager/application-features/doc/src/application-features.qdoc b/examples/applicationmanager/application-features/doc/src/application-features.qdoc index 78eb57b2..f0276c2d 100644 --- a/examples/applicationmanager/application-features/doc/src/application-features.qdoc +++ b/examples/applicationmanager/application-features/doc/src/application-features.qdoc @@ -110,7 +110,7 @@ The QML code for the two top-level windows application is as follows: This application is based on \l{QWidget}s. Compared to the other applications in this example, which are QML applications, this one uses the native runtime. Consequently, the application's entry point isn't a \c{main.qml} file, but an executable. This application is a basic application that -still adheres to this particular System UI. It's mean to illustrate the concept: the System UI +still adheres to this particular System UI. It's meant to illustrate the concept: the System UI needs a \c type window property to differentiate between normal windows and popups. This application only works in multi-process mode, as application processes cannot be started in 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 diff --git a/examples/applicationmanager/application-features/system-ui/main.qml b/examples/applicationmanager/application-features/system-ui/main.qml index a8e9125d..e6e00880 100644 --- a/examples/applicationmanager/application-features/system-ui/main.qml +++ b/examples/applicationmanager/application-features/system-ui/main.qml @@ -176,7 +176,6 @@ Window { model: ListModel { id: popupsModel } delegate: WindowItem { z: 9999 + model.index - width: 300; height: 100 anchors.centerIn: parent window: model.window Connections { |