diff options
author | Bernd Weimer <bernd.weimer@qt.io> | 2022-01-18 16:02:51 +0100 |
---|---|---|
committer | Bernd Weimer <bernd.weimer@qt.io> | 2022-01-19 09:17:09 +0100 |
commit | 98e900a40c9bb237b0c0ff5e50cc06f45923b42a (patch) | |
tree | 06435b38884c34cb325c80ca6115fdfc96167c29 | |
parent | e7aae3561f7b8c060dff2027a1a049e86ae78ad2 (diff) |
Improve examples
Fixed build issues, avoided warnings and improved output.
Pick-to: 6.2 6.3
Change-Id: I07f2e950399fb7b5a934686e5efe48cfaf7135e4
Reviewed-by: Robert Griebl <robert.griebl@qt.io>
13 files changed, 24 insertions, 21 deletions
diff --git a/examples/applicationmanager/application-features/apps/compositor/compositor.qml b/examples/applicationmanager/application-features/apps/compositor/compositor.qml index 64028fd3..8cdd8ffe 100644 --- a/examples/applicationmanager/application-features/apps/compositor/compositor.qml +++ b/examples/applicationmanager/application-features/apps/compositor/compositor.qml @@ -69,7 +69,7 @@ ApplicationManagerWindow { textFormat: Text.RichText text: "This Wayland<sup>*</sup> client window implements a Wayland compositor (nested compositor). " + "To display Wayland clients here, set:<br><br><b>WAYLAND_DISPLAY=qtam-wayland-nested</b>" + - "<br><br>For instance:<br>WAYLAND_DISPLAY=qtam-wayland-nested qmlscene client.qml -platform wayland" + + "<br><br>For instance:<br>WAYLAND_DISPLAY=qtam-wayland-nested qml client.qml -platform wayland" + "<br><br><small>* in multi-process mode</small>" } @@ -82,11 +82,11 @@ ApplicationManagerWindow { } WlShell { - onWlShellSurfaceCreated: shellSurfaces.append({shellSurface: shellSurface}); + onWlShellSurfaceCreated: (shellSurface) => shellSurfaces.append({shellSurface: shellSurface}); } XdgShell { - onToplevelCreated: shellSurfaces.append({shellSurface: xdgSurface}); + onToplevelCreated: (toplevel, xdgSurface) => shellSurfaces.append({shellSurface: xdgSurface}); } } @@ -100,5 +100,5 @@ ApplicationManagerWindow { Component.onCompleted: console.info("Start a client application in the nested compositor for instance with:\n " + "WAYLAND_DISPLAY=qtam-wayland-nested QT_WAYLAND_DISABLE_WINDOWDECORATION=1 " + - "QT_WAYLAND_SHELL_INTEGRATION=xdg-shell qmlscene client.qml -platform wayland"); + "QT_WAYLAND_SHELL_INTEGRATION=xdg-shell qml client.qml -platform wayland"); } diff --git a/examples/applicationmanager/application-features/doc/src/application-features.qdoc b/examples/applicationmanager/application-features/doc/src/application-features.qdoc index 3d81874d..4cf083cc 100644 --- a/examples/applicationmanager/application-features/doc/src/application-features.qdoc +++ b/examples/applicationmanager/application-features/doc/src/application-features.qdoc @@ -64,7 +64,7 @@ variable appropriately. To start a client with this environment variable set via command line: \badcode -WAYLAND_DISPLAY=qtam-wayland-nested qmlscene client.qml -platform wayland +WAYLAND_DISPLAY=qtam-wayland-nested qml client.qml -platform wayland \endcode This command only works in multi-process mode, since the nested compositor needs a real window as diff --git a/examples/applicationmanager/application-features/native/CMakeLists.txt b/examples/applicationmanager/application-features/native/CMakeLists.txt index de87a32a..97ebbcd1 100644 --- a/examples/applicationmanager/application-features/native/CMakeLists.txt +++ b/examples/applicationmanager/application-features/native/CMakeLists.txt @@ -1,3 +1,4 @@ +find_package(Qt6 COMPONENTS WaylandClient) if(TARGET Qt::WaylandClient AND TARGET Qt::Widgets) add_subdirectory(widgets) diff --git a/examples/applicationmanager/application-features/native/widgets/CMakeLists.txt b/examples/applicationmanager/application-features/native/widgets/CMakeLists.txt index 39d11923..b4c977da 100644 --- a/examples/applicationmanager/application-features/native/widgets/CMakeLists.txt +++ b/examples/applicationmanager/application-features/native/widgets/CMakeLists.txt @@ -17,6 +17,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/applicationmanager/application-fe find_package(Qt6 COMPONENTS Core) find_package(Qt6 COMPONENTS Gui) find_package(Qt6 COMPONENTS Widgets) +find_package(Qt6 COMPONENTS AppManLauncherPrivate) qt_add_executable(widgets main.cpp @@ -24,12 +25,12 @@ qt_add_executable(widgets set_target_properties(widgets PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE + RUNTIME_OUTPUT_DIRECTORY ../../apps/widgets ) target_link_libraries(widgets PUBLIC Qt::Core Qt::Gui Qt::Widgets - Qt::AppManCommonPrivate Qt::AppManLauncherPrivate ) diff --git a/examples/applicationmanager/application-features/native/widgets/widgets.pro b/examples/applicationmanager/application-features/native/widgets/widgets.pro index bf5ef1d4..9a93277d 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 appman_common-private +QT += widgets appman_launcher-private SOURCES = main.cpp diff --git a/examples/applicationmanager/intents/shared/IntentsApplicationWindow.qml b/examples/applicationmanager/intents/shared/IntentsApplicationWindow.qml index 648d018d..a46554f1 100644 --- a/examples/applicationmanager/intents/shared/IntentsApplicationWindow.qml +++ b/examples/applicationmanager/intents/shared/IntentsApplicationWindow.qml @@ -65,7 +65,7 @@ ApplicationManagerWindow { title: ApplicationInterface.name["en"] //! [Send Intent] - onRequest: { + onRequest: (intentId, applicationId, parameters) => { var request = IntentClient.sendIntentRequest(intentId, applicationId, parameters) request.onReplyReceived.connect(function() { intentPage.setResult(request.requestId, request.succeeded, @@ -107,7 +107,7 @@ ApplicationManagerWindow { //! [Intent Handler] IntentHandler { intentIds: "rotate-window" - onRequestReceived: { + onRequestReceived: (request) => { rotationAnimation.start() request.sendReply({ "done": true }) } @@ -116,7 +116,7 @@ ApplicationManagerWindow { IntentHandler { intentIds: "scale-window" - onRequestReceived: { + onRequestReceived: (request) => { scaleAnimation.start() request.sendReply({ "done": true }) } @@ -124,7 +124,7 @@ ApplicationManagerWindow { IntentHandler { intentIds: "blink-window" - onRequestReceived: { + onRequestReceived: (request) => { blinkAnimation.start() request.sendReply({ "done": true }) } @@ -132,7 +132,7 @@ ApplicationManagerWindow { IntentHandler { intentIds: "blue-window-private" - onRequestReceived: { + onRequestReceived: (request) => { blueAnimation.start() request.sendReply({ "done": true }) } diff --git a/examples/applicationmanager/intents/system-ui.qml b/examples/applicationmanager/intents/system-ui.qml index bf4bbc7e..058bb923 100644 --- a/examples/applicationmanager/intents/system-ui.qml +++ b/examples/applicationmanager/intents/system-ui.qml @@ -103,7 +103,7 @@ Item { height: parent.height / 2 title: "System UI" - onRequest: { + onRequest: (intentId, applicationId, parameters) => { var request = IntentClient.sendIntentRequest(intentId, applicationId, parameters) request.onReplyReceived.connect(function() { sysui_page.setResult(request.requestId, request.succeeded, @@ -121,7 +121,7 @@ Item { names: { "en": "Rotate System UI" } visibility: IntentObject.Public - onRequestReceived: { + onRequestReceived: (request) => { rotationAnimation.start() request.sendReply({ "wasRequestedBy": request.requestingApplicationId }) } diff --git a/examples/applicationmanager/launch-intents/apps/launch-intents.blue/main.qml b/examples/applicationmanager/launch-intents/apps/launch-intents.blue/main.qml index 3d265417..3c738c12 100644 --- a/examples/applicationmanager/launch-intents/apps/launch-intents.blue/main.qml +++ b/examples/applicationmanager/launch-intents/apps/launch-intents.blue/main.qml @@ -65,7 +65,7 @@ ApplicationManagerWindow { IntentHandler { intentIds: [ "launch" ] - onRequestReceived: { + onRequestReceived: (request) => { txt.counter++ request.sendReply({}) } diff --git a/examples/applicationmanager/launch-intents/apps/launch-intents.green/main.qml b/examples/applicationmanager/launch-intents/apps/launch-intents.green/main.qml index 998431ca..6ff54fac 100644 --- a/examples/applicationmanager/launch-intents/apps/launch-intents.green/main.qml +++ b/examples/applicationmanager/launch-intents/apps/launch-intents.green/main.qml @@ -65,7 +65,7 @@ ApplicationManagerWindow { IntentHandler { intentIds: [ "launch" ] - onRequestReceived: { + onRequestReceived: (request) => { txt.counter++ request.sendReply({}) } diff --git a/examples/applicationmanager/launch-intents/apps/launch-intents.red/main.qml b/examples/applicationmanager/launch-intents/apps/launch-intents.red/main.qml index de4da725..1f42dab8 100644 --- a/examples/applicationmanager/launch-intents/apps/launch-intents.red/main.qml +++ b/examples/applicationmanager/launch-intents/apps/launch-intents.red/main.qml @@ -68,7 +68,7 @@ ApplicationManagerWindow { IntentHandler { intentIds: [ "launch", "another-launch" ] - onRequestReceived: { + onRequestReceived: (request) => { if (request.intentId === "launch") txt.counter++ else diff --git a/examples/applicationmanager/minidesk/apps/tld.minidesk.app2/app2.qml b/examples/applicationmanager/minidesk/apps/tld.minidesk.app2/app2.qml index 9c64fdb6..bc0076ad 100644 --- a/examples/applicationmanager/minidesk/apps/tld.minidesk.app2/app2.qml +++ b/examples/applicationmanager/minidesk/apps/tld.minidesk.app2/app2.qml @@ -70,7 +70,9 @@ ApplicationManagerWindow { } } - onWindowPropertyChanged: console.log("App2: onWindowPropertyChanged - " + name + ": " + value); + onWindowPropertyChanged: (window, name, value) => { + console.log("App2: onWindowPropertyChanged - " + name + ": " + value); + } Connections { target: ApplicationInterface diff --git a/examples/applicationmanager/minidesk/system-ui/Readme.qml b/examples/applicationmanager/minidesk/system-ui/Readme.qml index d03118df..8dfca697 100644 --- a/examples/applicationmanager/minidesk/system-ui/Readme.qml +++ b/examples/applicationmanager/minidesk/system-ui/Readme.qml @@ -83,7 +83,6 @@ Item { "\u2022 Stop or restart App1 animations with a click\n" + "\u2022 App1 sends rotation angle as a window property to System UI on stop\n" + "\u2022 App1 shows a pop-up on the System UI while it is paused\n" + - "\u2022 App2 makes use of an IPC extension when it starts\n" + "\u2022 App2 logs the document URL that started it\n" + "\u2022 App2 triggers a notification in the System UI when the bulb icon is clicked\n" + "\u2022 Show Wayland client windows that originate from processes outside of appman" diff --git a/src/main-lib/Qt6AppManMainPrivateMacros.cmake b/src/main-lib/Qt6AppManMainPrivateMacros.cmake index 4e82e53b..2d8aef0c 100644 --- a/src/main-lib/Qt6AppManMainPrivateMacros.cmake +++ b/src/main-lib/Qt6AppManMainPrivateMacros.cmake @@ -77,7 +77,7 @@ function(qt6_am_add_systemui_wrapper target) file(GENERATE OUTPUT ${WRAPPER_SCRIPT} CONTENT "@echo off SetLocal EnableDelayedExpansion -(set PATH=${test_env_path}) +(set PATH=${test_env_path};%PATH%) (set QT_PLUGIN_PATH=${test_env_plugin_path}) $<TARGET_FILE_NAME:${ARG_EXECUTABLE}> ${CMD_ARGS_STR} ${CMD_EXTRA_ARGS_STR} ${ARG_MAIN_QML_FILE} %* EndLocal @@ -88,7 +88,7 @@ EndLocal set(WRAPPER_SCRIPT "_${target}$<CONFIG>${WRAPPER_SUFFIX}") file(GENERATE OUTPUT ${WRAPPER_SCRIPT} CONTENT "#!/bin/sh -export PATH=${test_env_path} +export PATH=${test_env_path}:$PATH export QT_PLUGIN_PATH=${test_env_plugin_path} exec $<TARGET_FILE_NAME:${ARG_EXECUTABLE}> ${CMD_ARGS_STR} ${CMD_EXTRA_ARGS_STR} ${ARG_MAIN_QML_FILE} \"$@\"; " |