Page

Search for usage in LXR

Page Class Reference
Inheritance diagram for Page:

Properties

bool altHeader
 
bool autoHideFooter
 
int autoHideFooterDelay
 
int autoHideFooterMargins
 
bool autoHideHeader
 
int autoHideHeaderDelay
 
int autoHideHeaderMargins
 
int bottomMargin
 
alias content
 
Flickable flickable
 
bool floatingFooter
 
bool floatingHeader
 
alias footBar
 
Item footer
 
alias footerColumn
 
alias footerContainer
 
int footerPositioning
 
alias headBar
 
Item header
 
int headerColorSet
 
alias headerColumn
 
alias headerContainer
 
int headerPositioning
 
alias internalHeight
 
int leftMargin
 
int margins
 
alias pageContent
 
int rightMargin
 
bool showTitle
 
string title
 
int topMargin
 

Signals

void goBackTriggered ()
 
void goForwardTriggered ()
 

Detailed Description

A page with a header and footer, that can be flipped among many other features.

Since
org.mauikit.controls 1.0

This control inherits from QQC2 Pane, to checkout its inherited properties refer to the Qt Docs.

This page has a header and footer bars that by default are set to a MauiKit ToolBar, the header bar can be dynamically moved to the bottom under the footer for better reachability on hand held devices like phones.

See also
ToolBar

Any other item can be placed as the header or footer. And the default toolbars can be populated easily via the aliases:

See also
headBar
footBar
{
id: _page
header: Rectangle
{
width: parent.width
height: 40
color: "pink"
}
}
A page with a header and footer, that can be flipped among many other features.
Definition Page.qml:158
Item header
The main single header bar.
Definition Page.qml:360
A Page with a header and footer - and then the header moved to the bottom under the footer

Features

Among other features, the page can have a reference to a flickable element to allow to have pull-back toolbar behaviour, floating toolbars, etc.

Pull-Back Bars

Pull-back bars allow to expand the contents areas by pulling away the header or footer when content is being flicked/scrolled - which is useful on phone screens. To enable this behaviour you need to reference the Flickable element via the flickable property.

See also
flickable

And set the header/footer positioning properties to ListView.PullBackHeader. By default this is set to the header if a flickable element has been assigned, so you can disable it by setting the property to ListView.InlineHeader.

See also
footerPositioning
headerPositioning

Bars Layout

As mentioned before, the Page has a header and footer area- the header can be moved to the bottom via the alternate header property. But you can also stack multiple bars vertically. So you can have two or more header/footer bars.

See also
altHeader

To attach more bars use the header and footer columns property.

See also
headerColumn
footerColumn
{
id: _page
Rectangle
{
width: parent.width
height: 40
color: "pink"
},
Rectangle
{
width: parent.width
height: 40
color: "yellow"
}
]
}
alias headerColumn
Quick way to add more children to the header bar.
Definition Page.qml:270

The header/footer layout is handled by a Column control, which can be accessed via the aliases to tweak the spacing for example.

See also
headerContainer
footerContainer
A Page with a default header bar and two rectangles stacked as part of the header column

Floating & AutoHide

The header and/or footer bars can be set to a floating position - which means they will flow over the page contents at the bottom and top. When this is enable a translucency effect will be applied to hint about the content being covered underneath.

See also
floatingFooter
floatingHeader

The bars can also be set to auto-hide, when the cursor moves out or shown again when the cursor enters the bar area.

See also
autoHideFooter
autoHideHeader

The time to trigger this actions can be tweaked using the delay properties.

See also
autoHideFooterDelay
autoHideHeaderDelay

And to finetune the target area which reacts to enter and exit events, use the margins property:

See also
autoHideFooterMargins
autoHideHeaderMargins
A Page with a floating header - and a translucent effect

Notes

This component is an alternative to the QQC2 Page control, where the header and footer can not be moved easily - and it adds a few more functionality.

The padding properties will affect the header and footer, so if instead you meant to add internal padding to the page contents, you can use the margins properties.

When used in a StackView or SwipeView, this Page emits two signals for the go forward/back actions, which can be consumed to pop or push pages.

See also
goBackTriggered
{
id: _page
headBar.rightContent: Switch
{
text: "Alt Header"
checked: _page.altHeader
onToggled: _page.altHeader = checked
}
}
bool altHeader
If set to true the header bar will be positioned to the bottom under the footer bar.
Definition Page.qml:302
alias headBar
An alias to the default ToolBar as the header bar.
Definition Page.qml:247
An ApplicationWindow filled with a Page and with the CSD controls enabled

You can find a more complete example at this link.

Note
This control supports the attached Controls.showCSD property to display the window control buttons when using CSD. This is only supported if used with the MauiKit ToolBar as the header bar - which is the default. If use with another header element, the window control buttons need to be added manually.

Definition at line 158 of file Page.qml.

Property Documentation

◆ altHeader

bool Page::altHeader
read

If set to true the header bar will be positioned to the bottom under the footer bar.

This makes sense in some cases for better reachability, or custom design patterns.

Definition at line 302 of file Page.qml.

◆ autoHideFooter

bool Page::autoHideFooter
read

If the footer bar should autohide under certain given condition.

To fine tune a enter/exit threshold, a margin can be set, and a time delay.

Definition at line 312 of file Page.qml.

◆ autoHideFooterDelay

int Page::autoHideFooterDelay
read

Span of time to hide the footer bar after the conditions have been met.

If within the span of time the conditions changed then the timer gets reseted.

Definition at line 327 of file Page.qml.

◆ autoHideFooterMargins

int Page::autoHideFooterMargins
read

Size in pixels for the cursor enter/exit threshold for when the footer should autohide.

The default value is set to Style.toolBarHeight.

Definition at line 322 of file Page.qml.

◆ autoHideHeader

bool Page::autoHideHeader
read

If the header bar should autohide under certain given condition.

To fine tune a enter/exit threshold, a margin can be set, and a time delay.

Definition at line 307 of file Page.qml.

◆ autoHideHeaderDelay

int Page::autoHideHeaderDelay
read

Span of time to hide the header bar after the conditions have been met.

If within the span of time the conditions changed then the timer gets reseted.

Definition at line 332 of file Page.qml.

◆ autoHideHeaderMargins

int Page::autoHideHeaderMargins
read

Size in pixels for the cursor enter/exit threshold for when the header should autohide.

The default value is set to Style.toolBarHeight.

Definition at line 317 of file Page.qml.

◆ bottomMargin

int Page::bottomMargin
read

Page bottom margins.

Definition at line 297 of file Page.qml.

◆ content

list< QtObject > Page::content
read

The default content of the page.

Remarks
This is the default property

To position child elements use anchors or do it manually.

Note
This is a default property

Definition at line 177 of file Page.qml.

◆ flickable

Flickable Page::flickable
read

A flickable element can be referenced in order to support the header and footer positioning options such as Inline, Pullback or floating.

If a flickable is set, the page will modify its top or bottom margins properties. And watch for changes in the Flickable properties, such as contentX and contentY in order to support the formerly mentioned features.

Definition at line 196 of file Page.qml.

◆ floatingFooter

bool Page::floatingFooter
read

If the footer bar should float over the page contents, if a flickable has been set then the default footer bar will have a translucent ShaderEffect to hint about the content under it.

Definition at line 341 of file Page.qml.

◆ floatingHeader

bool Page::floatingHeader
read

If the header bar should float over the page contents, if set- then the default footer bar will have a translucent ShaderEffect to hint about the content under it.

Definition at line 336 of file Page.qml.

◆ footBar

ToolBar Page::footBar
read

An alias to the default ToolBar as the footer bar.

The toolbar is a MauiKit ToolBar.

Definition at line 253 of file Page.qml.

◆ footer

Item Page::footer
read

The main single footer bar.

By default this footer is set to a MauiKit ToolBar, but it can be changed to any other item.

See also
ToolBar

Definition at line 372 of file Page.qml.

◆ footerColumn

list< QtObject > Page::footerColumn
read

Quick way to add more children to the footer bar.

The footer bar is handled by a Column.

Definition at line 259 of file Page.qml.

◆ footerContainer

Column Page::footerContainer
read

The actual container for all the footer bars.

Definition at line 264 of file Page.qml.

◆ footerPositioning

int Page::footerPositioning
read

The footer bar can be place static and always visible with the InlineFooter value, or moved along with the flickable contents when using the PullBackFooter value.

This is only supported if a flickable element has been set.

See also
flickable By default this is set to InlineFooter.

Possible values are:

  • ListView.PullBackFooter
  • ListView.InlineFooter

Definition at line 207 of file Page.qml.

◆ headBar

ToolBar Page::headBar
read

An alias to the default ToolBar as the header bar.

The toolbar is a MauiKit ToolBar.

See also
ToolBar

Definition at line 247 of file Page.qml.

◆ header

Item Page::header
read

The main single header bar.

By default this header is set to a MauiKit ToolBar, but it can be changed to any other item.

See also
ToolBar

Definition at line 360 of file Page.qml.

◆ headerColorSet

int Page::headerColorSet
read

Convinient way to change the color set of the default header.

{
headerColorSet: Theme.Complementary
}
int headerColorSet
Convinient way to change the color set of the default header.
Definition Page.qml:229

Definition at line 229 of file Page.qml.

◆ headerColumn

list< QtObject > Page::headerColumn
read

Quick way to add more children to the header bar.

The header bar is handled by a Colum.

Definition at line 270 of file Page.qml.

◆ headerContainer

Column Page::headerContainer
read

The actual container for all the header bars.

Definition at line 275 of file Page.qml.

◆ headerPositioning

int Page::headerPositioning
read

The header bar can be place static and always visible with the InlineHeader value, or moved along with the flickable contents when using the PullBackHeader value.

This is only supported if a flickable element has been set.

See also
flickable

By default this is set to InlineHeader unless a Flickable has been attached, in which case it is set to PullBackHeader.

Possible values are:

  • ListView.PullBackHeader
  • ListView.InlineHeader

Definition at line 219 of file Page.qml.

◆ internalHeight

int Page::internalHeight
read

The actual height of the page contents without the header or footer bars height.

Remarks
This property is read-only

Definition at line 190 of file Page.qml.

◆ leftMargin

int Page::leftMargin
read

Page left margins.

Definition at line 285 of file Page.qml.

◆ margins

int Page::margins
read

The page margins for the page contents.

This margins do not affect the header or footer bars. By default this is set to 0

Definition at line 281 of file Page.qml.

◆ pageContent

Item Page::pageContent
read

An alias to the actual page container.

Remarks
This property is read-only

Definition at line 183 of file Page.qml.

◆ rightMargin

int Page::rightMargin
read

Page right margins.

Definition at line 289 of file Page.qml.

◆ showTitle

bool Page::showTitle
read

If a title is set and this is set to true, such title will be displayed in the default header bar in the middle.

Definition at line 240 of file Page.qml.

◆ title

string Page::title
read

A title for the page.

This title is shown in the middle of the default header bar if the show title property is set to true.

See also
showTitle The displayed title in the header bar won't wrap, but will elide in the middle.

Definition at line 236 of file Page.qml.

◆ topMargin

int Page::topMargin
read

Page top margins.

Definition at line 293 of file Page.qml.

Member Function Documentation

◆ goBackTriggered

void Page::goBackTriggered ( )
signal

Emitted when the user has requested to go back by a gesture or keyboard shortcut.

◆ goForwardTriggered

void Page::goForwardTriggered ( )
signal

Emitted when the user has requested to go forward by a gesture or keyboard shortcut.


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 Tue Mar 26 2024 11:16:19 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.