ApplicationManagerWindow QML Type

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

Import Statement: import QtApplicationManager.Application 2.0
Inherits:

Window

Properties

Attached Properties

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. In order to achieve this, this class is not derived from QQuickWindow directly, but from QObject.

The API closely resembles that of Window, but there are some things missing, which are either not applicable for the embedded use case or cannot be supported in the single-process case. If you need access to those, you still can via the backingObject property. Check the the singleProcess property to see if you are in single-process mode and if the actual backingObject is an Item or a Window.

In contrast to a Window, an ApplicationManagerWindow is visible by default.

Additional details can be found in the section about the root element and application windows.

Note: Before version 6.7, this class inherited from Window in multi-process and from QtObject in single-process mode, but that made it impossible to use qml tooling on this class. There are no "revision" markers in the QML API and no "since" markers in the documentation after re-implementing this class, as it would be ambiguous which of the two old implementations they refer to.

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
    }
}

Property Documentation

height : int

width : int

x : int

y : int

Defines the window's position and size.

The (x,y) position is relative to the compositors screens.


minimumHeight : int

minimumWidth : int

Defines the window's minimum size.

This is a hint to the compositor to prevent resizing below the specified width and height.


maximumHeight : int

maximumWidth : int

Defines the window's maximum size.

This is a hint to the compositor to prevent resizing above the specified width and height.


active : bool

The active status of the window.


activeFocusItem : Item

The item which currently has active focus or null if there is no item with active focus.


backingObject : QtObject [read-only]

This property holds the backing object of this window: in single-process mode, this is an an Item acting as a container for contentItem, but in multi-process mode, it is the actual Window instance.


color : color

The background color for the window.

Setting this property is more efficient than using a separate Rectangle.

Note: Since version 6.7, if an alpha channel is used, it needs to be straight alpha. Pre 6.7 it needed to be pre-multiplied alpha (which is what the Window QML type still expects) in multi-process and straight alpha in single-process mode.


contentItem : Item [read-only]

The invisible root item of the scene.


opacity : real

The opacity of the window.

A value of 1.0 or above is treated as fully opaque, whereas a value of 0.0 or below is treated as fully transparent. Values in between represent varying levels of translucency between the two extremes.

The default value is 1.0.


singleProcess : bool [read-only]

This property is true when the application is running in single-process mode and false when it is running in multi-process mode.

See also ApplicationManager::singleProcess.


title : string

The window's title in the windowing system.


visibility : QWindow::Visibility

The screen-occupation state of the window.

Visibility is whether the window should appear in the windowing system as normal, minimized, maximized, fullscreen or hidden.

See Window::visibility for more details. In single-process mode, the minimized, maximized and fullscreen states are not supported and simply map to normal.


visible : bool

Whether the window is visible on the screen.

Setting visible to false is the same as setting visibility to Hidden.

See also visibility.


Attached Property Documentation

ApplicationManagerWindow.height : int [read-only]

ApplicationManagerWindow.width : int [read-only]

These attached properties hold the size of the item's window. The ApplicationManagerWindow attached property can be attached to any Item.


ApplicationManagerWindow.active : bool

This attached property tells whether the window is active. The ApplicationManagerWindow attached property can be attached to any Item.


ApplicationManagerWindow.activeFocusItem : Item [read-only]

This attached property holds the item which currently has active focus or null if there is no item with active focus. The ApplicationManagerWindow attached property can be attached to any Item.


ApplicationManagerWindow.backingObject : QtObject [read-only]

This attached property holds backingObject of the ApplicationManagerWindow.

See also ApplicationManagerWindow::backingObject.


ApplicationManagerWindow.contentItem : Item [read-only]

This attached property holds the invisible root item of the scene or null if the item is not in a window. The ApplicationManagerWindow attached property can be attached to any Item.


ApplicationManagerWindow.visibility : QWindow::Visibility [read-only]

This attached property holds whether the window is currently shown in the windowing system as normal, minimized, maximized, fullscreen or hidden. The ApplicationManagerWindow attached property can be attached to any Item. If the item is not shown in any ApplicationManagerWindow, the value will be Hidden.

See also visible and visibility.


ApplicationManagerWindow.window : ApplicationManagerWindow [read-only]

This attached property holds the item's ApplicationManagerWindow. The ApplicationManagerWindow attached property can be attached to any Item.


Signal Documentation

void afterAnimating()

This signal is forwarded from the underlying QQuickWindow object: either the corresponding QQuickWindow for this object in multi-process mode, or the System UI's QQuickWindow in single-process mode.

Note: The corresponding handler is onAfterAnimating.


closing(CloseEvent close)

This signal is emitted when the user tries to close the window.

This signal includes a close parameter. The close.accepted property is true by default so that the window is allowed to close, but you can implement an onClosing handler and set close.accepted = false if you need to do something else before the window can be closed.

Note: The corresponding handler is onClosing.


void frameSwapped()

This signal is forwarded from the underlying QQuickWindow object: either the corresponding QQuickWindow for this object in multi-process mode, or the System UI's QQuickWindow in single-process mode.

Note: The corresponding handler is onFrameSwapped.

See also QQuickWindow::frameSwapped().


void sceneGraphError(QQuickWindow::SceneGraphError error, string message)

This signal with its parameters error and message is forwarded from the underlying QQuickWindow object: either the corresponding QQuickWindow for this object in multi-process mode, or the System UI's QQuickWindow in single-process mode.

Note: The corresponding handler is onSceneGraphError.

See also QQuickWindow::sceneGraphError().


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

close()

Closes the window.

When this method is called, the closing signal will be emitted. If there is no handler, or the handler does not revoke permission to close, the window will subsequently close. If the QGuiApplication::quitOnLastWindowClosed property is true, and if there are no other windows open, the application will quit.


void hide()

Hides the window.

Equivalent to setting visible to false or visibility to Hidden.

See also show().


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.


void show()

Shows the window.

Equivalent to setting visible to true.

See also hide() and visibility.


void showFullScreen()

This call is passed through to the underlying QWindow object in multi-process mode. The single-process mode does not support window states, so this call gets mapped to a simple show().

See also QWindow::showFullScreen().


void showMaximized()

This call is passed through to the underlying QWindow object in multi-process mode. The single-process mode does not support window states, so this call gets mapped to a simple show().

See also QWindow::showMaximized().


void showMinimized()

This call is passed through to the underlying QWindow object in multi-process mode. The single-process mode does not support window states, so this call gets mapped to a simple show().

See also QWindow::showMinimized().


void showNormal()

This call is passed through to the underlying QWindow object in multi-process mode. The single-process mode does not support window states, so this call gets mapped to a simple show().

See also QWindow::showNormal().


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.


© 2024 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.