ApplicationManagerWindow QML Type

The window root element of an application. More...

Import Statement: import QtApplicationManager.Application 2.0
Inherits:

Window

Signals

Methods

Detailed Description

This QML item can be used as the root item in your QML application. In doing so, you enable your application to be usable in both single-process (EGL fullscreen, desktop) and multi-process (Wayland) mode. It inherits from Window in multi-process and from QtObject in single-process mode. In contrast to a Window it is visible by default. This documentation reflects the Window inheritance. Note that only a subset of the Window type members have been added to ApplicationManagerWindow when derived from QtObject. Additional details can be found in the section about the root element and application windows.

The QML import for this item is

import QtApplicationManager.Application

After importing, you can instantiate the QML item like so:

import QtQuick
import QtApplicationManager.Application

ApplicationManagerWindow {
    Text {
        text: ApplicationInterface.applicationId
    }
}

In order to make your applications easily runnable outside of the application manager, even though you are using an ApplicationManagerWindow as a root item, you can simply provide this little dummy import to your application.

  1. Pick a base dir and create a QtApplicationManager.Application directory in it
  2. Add a file named qmldir there, consisting of the single line ApplicationManagerWindow 2.0 ApplicationManagerWindow.qml
  3. Add a second file named ApplicationManagerWindow.qml, with the following content
    import QtQuick
    
    Window {
        signal windowPropertyChanged
        function setWindowProperty(name, value) {}
        // ... add additional dummy members that are used by your implementation
    
        width: 1280   // use your screen width here
        height: 600   // use your screen height here
        visible: true
    }

Now you can run your appication for instance with: qml -I <path to base dir>

Signal Documentation

windowPropertyChanged(string name, var value)

Reports a change of this application window's property identified by name to the given value.

Note: The corresponding handler is onWindowPropertyChanged.

See also setWindowProperty.


Method Documentation

void setWindowProperty(string name, var &value)

Sets this application window's shared property identified by name to the given value.

These properties are shared between the System UI and the client applications: in single-process mode simply via a QVariantMap; in multi-process mode via Qt's extended surface Wayland extension. Changes from the client side are signalled via windowPropertyChanged.

See WindowManager for the server side API.

Note: When listening to property changes of Wayland clients on the System UI side, be aware of the asynchronous nature of the underlying Wayland protocol.

See also windowProperty, windowProperties, and windowPropertyChanged.


object windowProperties()

Returns an object containing all shared properties of this application window.

See also setWindowProperty.


var windowProperty(string name)

Returns the value of this application window's shared property identified by name.

See also setWindowProperty.


© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.