AbstractApplicationWindow QML Type

Import Statement: import org.kde.kirigami
Inherits:

ApplicationWindow (QtQuick.Controls)

Inherited By:

ApplicationWindow (org.kde.kirigami)

Properties

Methods

Detailed Description

A window that provides some basic features needed for all apps Use this class only if you need a custom content for your application, different from the Page Row behavior recommended by the HIG and provided by ApplicationWindow. It is recommended to use ApplicationWindow instead

It's usually used as a root QML component for the application. It provides support for a central page stack, side drawers, and basic support for the Android back button.

Setting a width and height property on the ApplicationWindow will set its initial size, but it won't set it as an automatically binding. to resize programmatically the ApplicationWindow they need to be assigned again in an imperative fashion

Example usage:

import org.kde.kirigami as Kirigami

Kirigami.ApplicationWindow {
 [...]
    globalDrawer: Kirigami.GlobalDrawer {
        actions: [
           Kirigami.Action {
               text: "View"
               icon.name: "view-list-icons"
               Kirigami.Action {
                       text: "action 1"
               }
               Kirigami.Action {
                       text: "action 2"
               }
               Kirigami.Action {
                       text: "action 3"
               }
           },
           Kirigami.Action {
               text: "Sync"
               icon.name: "folder-sync"
           }
        ]
    }

    contextDrawer: Kirigami.ContextDrawer {
        id: contextDrawer
    }

    pageStack: PageStack {
        ...
    }
 [...]
}

Property Documentation

contextDrawer : OverlayDrawer

This property holds the drawer for context-dependent actions.

The drawer that will be opened by sliding from the right screen edge or by dragging the ActionButton to the left.

Note: It is recommended to use the ContextDrawer type here.

The contents of the context drawer should depend from what page is loaded in the main pageStack

Example usage:

import org.kde.kirigami as Kirigami

Kirigami.ApplicationWindow {
    contextDrawer: Kirigami.ContextDrawer {
        enabled: true
        actions: [
            Kirigami.Action {
                icon.name: "edit"
                text: "Action text"
                onTriggered: {
                    // do stuff
                }
            },
            Kirigami.Action {
                icon.name: "edit"
                text: "Action text"
                onTriggered: {
                    // do stuff
                }
            }
        ]
    }
}

controlsVisible : bool [default: true]

This property sets whether the standard chrome of the app is visible.

These are the action button, the drawer handles, and the application header.


globalDrawer : OverlayDrawer

This property holds the drawer for global actions.

This drawer can be opened by sliding from the left screen edge or by dragging the ActionButton to the right.

Note: It is recommended to use the GlobalDrawer here.


overlay : Item [read-only]

Effectively the same as Overlay.overlay


pageStack : Item

This property holds the stack used to allocate the pages and to manage the transitions between them.

Put a container here, such as QtQuick.Controls.StackView.


quitAction : Kirigami.Action [read-only, since 5.76]

This property holds a standard action that will quit the application when triggered. Its properties have the following values:

Action {
    text: "Quit"
    icon.name: "application-exit-symbolic"
    shortcut: StandardKey.Quit
    // ...
}

This property was introduced in 5.76.


wideScreen : bool

This property tells whether the application is in "widescreen" mode.

This is enabled on desktops or horizontal tablets.

Note: Different styles can have their own logic for deciding this.


Method Documentation

applicationWindow()

This function returns application window's object anywhere in the application. Returns a pointer to this application window can be used anywhere in the application.


hidePassiveNotification(index = 0)

This function hides the passive notification at specified index, if any is shown.

index Index of the notification to hide. Default is 0 (oldest notification).


void showPassiveNotification(string message, int timeout, string actionText, var callBack)

This function shows a little passive notification at the bottom of the app window lasting for few seconds, with an optional action button.

message The text message to be shown to the user.

timeout How long to show the message: possible values: "short", "long" or the number of milliseconds

actionText Text in the action button, if any.

callBack A JavaScript function that will be executed when the user clicks the button.