org::kde::kirigami::AbstractApplicationWindow

Search for usage in LXR

org::kde::kirigami::AbstractApplicationWindow Class Reference
Inheritance diagram for org::kde::kirigami::AbstractApplicationWindow:

Properties

Kirigami Action
 
OverlayDrawer contextDrawer
 
bool controlsVisible
 
OverlayDrawer globalDrawer
 
Item pageStack
 
bool reachableMode
 
bool reachableModeEnabled
 
bool wideScreen
 

Public Member Functions

void applicationWindow ()
 
void hidePassiveNotification (index=0)
 
void showPassiveNotification (message, timeout, actionText, callBack)
 

Detailed Description

A window that provides some basic features needed for all apps.

An abstract application window is a top-level component that provides several utilities for convenience such as:

  • ::applicationWindow()
  • ::globalDrawer
  • ::pageStack
  • ::wideScreen

Use this class only if you need custom content for your application that is different from the PageRow behavior recommended by the HIG and provided by kirigami::AbstractApplicationWindow.

Example usage:

import org.kde.kirigami 2.4 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 {
}
pageStack.initialPage: Kirigami.Page {
actions.contextualActions: [
Kirigami.Action {
text: "context action 1"
},
Kirigami.Action {
text: "context action 2"
},
Kirigami.Action {
text: "context action 3"
}
]
}
[...]
}

Definition at line 76 of file AbstractApplicationWindow.qml.

Property Documentation

◆ Action

Kirigami org::kde::kirigami::AbstractApplicationWindow::Action
read

This property holds a Kirigami action that will quit the application when triggered.

Since
KDE Frameworks 5.76
Remarks
This property is read-only

Definition at line 192 of file AbstractApplicationWindow.qml.

◆ contextDrawer

kirigami::ContextDrawer org::kde::kirigami::AbstractApplicationWindow::contextDrawer
read

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 class here.

The context drawer will display the previously defined contextual actions of the page that is currently active in the pageStack.

Example usage:

import org.kde.kirigami 2.4 as Kirigami
Kirigami.ApplicationWindow {
[...]
contextDrawer: Kirigami.ContextDrawer {
}
[...]
}
import org.kde.kirigami 2.4 as Kirigami
Kirigami.Page {
[...]
// setting the contextual actions
actions.contextualActions: [
Kirigami.Action {
icon.name: "edit"
text: "Action text"
onTriggered: {
// do stuff
}
},
Kirigami.Action {
icon.name: "edit"
text: "Action text"
onTriggered: {
// do stuff
}
}
]
[...]
}

Definition at line 166 of file AbstractApplicationWindow.qml.

◆ controlsVisible

bool org::kde::kirigami::AbstractApplicationWindow::controlsVisible
read

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

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

default: true

Definition at line 95 of file AbstractApplicationWindow.qml.

◆ globalDrawer

kirigami::OverlayDrawer org::kde::kirigami::AbstractApplicationWindow::globalDrawer
read

This property holds the drawer for global actions.

This drawer can be opened by sliding from the left screen edge or by either pressing on the handle or sliding it to the right.

Note
It is recommended to use the GlobalDrawer here.

Definition at line 105 of file AbstractApplicationWindow.qml.

◆ pageStack

Item org::kde::kirigami::AbstractApplicationWindow::pageStack
read

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 or PageRow.

Definition at line 85 of file AbstractApplicationWindow.qml.

◆ reachableMode

bool org::kde::kirigami::AbstractApplicationWindow::reachableMode
read

This property specifies whether the application is in reachable mode for single hand use.

The whole content of the application is moved down the screen to be reachable with the thumb. If wideScreen is true, or reachableModeEnabled is false, this property has no effect.

Warning
This property should be treated as readonly. Use reachableModeEnabled instead.

default: false

Definition at line 180 of file AbstractApplicationWindow.qml.

◆ reachableModeEnabled

bool org::kde::kirigami::AbstractApplicationWindow::reachableModeEnabled
read

This property sets whether reachable mode can be used.

Definition at line 184 of file AbstractApplicationWindow.qml.

◆ wideScreen

bool org::kde::kirigami::AbstractApplicationWindow::wideScreen
read

This property specifies 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.

Definition at line 113 of file AbstractApplicationWindow.qml.

Member Function Documentation

◆ applicationWindow()

void org::kde::kirigami::AbstractApplicationWindow::applicationWindow ( )

This property returns a pointer to the main instance of AbstractApplicationWindow.

This is available to any children of this window, including those instantiated from separate QML files, making interoperation with multiple files easier.

Use this whenever you need access to properties that are available to the main AbstractApplicationWindow, such as its ::pageStack or ::globalDrawer.

See also
AbstractApplicationItem::applicationWindow()
Returns
a pointer to the instantiated AbstractApplicationWindow.

◆ hidePassiveNotification()

void org::kde::kirigami::AbstractApplicationWindow::hidePassiveNotification ( index  = 0)

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

Parameters
indexIndex of the notification to hide. Default is 0 (oldest notification).

◆ showPassiveNotification()

void org::kde::kirigami::AbstractApplicationWindow::showPassiveNotification ( message  ,
timeout  ,
actionText  ,
callBack   
)

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

Parameters
messageNotification's text message that is shown to the user.
timeoutNotification's visibility duration. Possible values are: "short", "long" or the number of milliseconds. Default is 7000.
actionTextNotification's action button's text.
callBackA JavaScript function that will be executed when the user clicks the button.

The documentation for this class was generated from the following file:
OverlayDrawer contextDrawer
This property holds the drawer for context-dependent actions.
OverlayDrawer globalDrawer
This property holds the drawer for global actions.
Item pageStack
This property holds the stack used to allocate the pages and to manage the transitions between them.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Sep 26 2023 04:05:32 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.