AbstractApplicationItem

Search for usage in LXR

AbstractApplicationItem Class Reference
Inheritance diagram for AbstractApplicationItem:

Properties

Item background
 
color color
 
Item contentItem
 
OverlayDrawer contextDrawer
 
bool controlsVisible
 
font font
 
Item footer
 
OverlayDrawer globalDrawer
 
KTAbstractApplicationHeader header
 
Locale locale
 
TMenuBar menuBar
 
alias overlay
 
Item pageStack
 
bool wideScreen
 

Public Member Functions

void applicationWindow ()
 
void hidePassiveNotification (index=0)
 
void showPassiveNotification (message, timeout, actionText, callBack)
 
- Public Member Functions inherited from QtQuick.Item
 childAt (real x, real y)
 
bool contains (point point)
 
 dumpItemTree ()
 
 forceActiveFocus ()
 
 forceActiveFocus (Qt::FocusReason reason)
 
bool grabToImage (callback, targetSize)
 
point mapFromGlobal (real x, real y)
 
point mapFromItem (Item item, point p)
 
point mapFromItem (Item item, real x, real y)
 
rect mapFromItem (Item item, real x, real y, real width, real height)
 
rect mapFromItem (Item item, rect r)
 
point mapToGlobal (real x, real y)
 
point mapToItem (Item item, point p)
 
point mapToItem (Item item, real x, real y)
 
rect mapToItem (Item item, real x, real y, real width, real height)
 
rect mapToItem (Item item, rect r)
 
 nextItemInFocusChain (bool forward)
 

Detailed Description

An item that provides the features of AbstractApplicationWindow without the window itself.

This allows embedding into a larger application. Unless you need extra flexibility it is recommended to use ApplicationItem instead.

Example usage:

import org.kde.kirigami as Kirigami
Kirigami.AbstractApplicationItem {
[...]
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: Kirigami.PageRow {
...
}
[...]
}
Item pageStack
This property holds the stack used to allocate the pages and to manage the transitions between them.
OverlayDrawer contextDrawer
This property holds the drawer for context-dependent actions.

Definition at line 56 of file AbstractApplicationItem.qml.

Property Documentation

◆ background

Item AbstractApplicationItem::background
read

This property holds the background of the Application UI.

Definition at line 184 of file AbstractApplicationItem.qml.

◆ color

color AbstractApplicationItem::color
read

This property holds the color for the background.

default: Kirigami.Theme.backgroundColor

Definition at line 180 of file AbstractApplicationItem.qml.

◆ contentItem

Item AbstractApplicationItem::contentItem
read

This property holds the Item of the main part of the Application UI.

Remarks
This property is read-only

Definition at line 174 of file AbstractApplicationItem.qml.

◆ contextDrawer

OverlayDrawer AbstractApplicationItem::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 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
}
}
]
}
}

Definition at line 169 of file AbstractApplicationItem.qml.

◆ controlsVisible

bool AbstractApplicationItem::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 109 of file AbstractApplicationItem.qml.

◆ font

font AbstractApplicationItem::font
read

This property holds the font for this item.

default: Kirigami.Theme.defaultFont

Definition at line 71 of file AbstractApplicationItem.qml.

◆ footer

Item AbstractApplicationItem::footer
read

This property holds an item that can be used as a footer for the application.

Definition at line 101 of file AbstractApplicationItem.qml.

◆ globalDrawer

OverlayDrawer AbstractApplicationItem::globalDrawer
read

This property holds the drawer for global actions.

Thos 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.

Definition at line 119 of file AbstractApplicationItem.qml.

◆ header

KTAbstractApplicationHeader AbstractApplicationItem::header
read

This property holds an item that can be used as a title for the application.

Scrolling the main page will make it taller or shorter (through the point of going away).

It's a behavior similar to the typical mobile web browser addressbar.

The minimum, preferred and maximum heights of the item can be controlled with

  • Layout.minimumHeight: default is 0, i.e. hidden
  • Layout.preferredHeight: default is Kirigami.Units.gridUnit * 1.6
  • Layout.maximumHeight: default is Kirigami.Units.gridUnit * 3

To achieve a titlebar that stays completely fixed, just set the 3 sizes as the same.

Definition at line 97 of file AbstractApplicationItem.qml.

◆ locale

Locale AbstractApplicationItem::locale
read

This property holds the locale for this item.

Definition at line 75 of file AbstractApplicationItem.qml.

◆ menuBar

TMenuBar AbstractApplicationItem::menuBar
read

This property holds an item that can be used as a menuBar for the application.

Definition at line 79 of file AbstractApplicationItem.qml.

◆ overlay

alias AbstractApplicationItem::overlay
read

Definition at line 186 of file AbstractApplicationItem.qml.

◆ pageStack

Item AbstractApplicationItem::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.

Definition at line 65 of file AbstractApplicationItem.qml.

◆ wideScreen

bool AbstractApplicationItem::wideScreen
read

This property tells us 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 127 of file AbstractApplicationItem.qml.

Member Function Documentation

◆ applicationWindow()

void AbstractApplicationItem::applicationWindow ( )

This property gets application windows object anywhere in the application.

Returns
a pointer to this item.

◆ hidePassiveNotification()

void AbstractApplicationItem::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 AbstractApplicationItem::showPassiveNotification ( message ,
timeout ,
actionText ,
callBack  )

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

Parameters
messageThe text message to be shown to the user.
timeoutHow long to show the message: possible values: "short", "long" or the number of milliseconds
actionTextText in the action button, if any.
callBackA JavaScript function that will be executed when the user clicks the button.

The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 19 2024 11:52:23 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.