PageRow QML Type

Import Statement: import org.kde.kirigami

Properties

Signals

Methods

Detailed Description

PageRow implements a row-based navigation model, which can be used with a set of interlinked information pages. Pages are pushed in the back of the row and the view scrolls until that row is visualized. A PageRow can show a single page or a multiple set of columns, depending on the window width: on a phone a single column should be fullscreen, while on a tablet or a desktop more than one column should be visible.

Property Documentation

columnView : ColumnView [since 2.12]

This property holds the ColumnView that this PageRow owns.

Generally, you shouldn't need to change the value of this property.

This property was introduced in 2.12.


currentIndex : int

This property holds the index of the currently active page.

See also currentItem.


currentItem : Page [read-only]

This property holds the currently visible/active page.

Because of the ability to display multiple pages, it will hold the currently active page.


defaultColumnWidth : int

This property holds the default width for a column.

default: 20 * Kirigami.Units.gridUnit

Note: Pages can override it using implicitWidth, Layout.fillWidth, Layout.minimumWidth etc.


depth : int [read-only]

This property holds the number of pages currently pushed onto the view.


globalToolBar : var [read-only, since 5.48]

This property sets the appearance of an optional global toolbar for the whole PageRow.

It's a grouped property comprised of the following properties:

  • style (Kirigami.ApplicationHeaderStyle): can have the following values:
    • Auto: Depending on application formfactor, it can behave automatically like other values, such as a Breadcrumb on mobile and ToolBar on desktop.
    • Breadcrumb: It will show a breadcrumb of all the page titles in the stack, for easy navigation.
    • Titles: Each page will only have its own title on top.
    • ToolBar: Each page will have the title on top together buttons and menus to represent all of the page actions. Not available on Mobile systems.
    • None: No global toolbar will be shown.
  • actualStyle: This will represent the actual style of the toolbar; it can be different from style in the case style is Auto.
  • showNavigationButtons: OR flags combination of Kirigami.ApplicationHeaderStyle.ShowBackButton and Kirigami.ApplicationHeaderStyle.ShowForwardButton.
  • toolbarActionAlignment (Qt::Alignment): How to horizontally align the actions when using the ToolBar style. Note that anything but Qt.AlignRight will cause the title to be hidden (default: Qt.AlignRight).
  • minimumHeight: int Minimum height of the header, which will be resized when scrolling. Only in Mobile mode (default: preferredHeight, sliding but no scaling).
  • preferredHeight: int The height the toolbar will usually have.
  • leftReservedSpace: int, readonly How many pixels of extra space are reserved at the left of the page toolbar (typically for navigation buttons or a drawer handle).
  • rightReservedSpace: int, readonly How many pixels of extra space are reserved at the right of the page toolbar (typically for a drawer handle).

This property was introduced in 5.48.


initialPage : Page

This property sets the initial page for this PageRow.


interactive : bool

This property sets whether it is possible to go back/forward by swiping with a gesture on the content view.

default: true


items : Page [read-only, since 2.6]

This property holds the present pages in the PageRow.

This property was introduced in 2.6.


lastItem : Page [read-only]

This property holds the last page in the row.


layers : QtQuick.Controls.StackView [since 5.38]

This property holds the modal layers.

Sometimes an application needs a modal page that always covers all the rows. For instance the full screen image of an image viewer or a settings page.

This property was introduced in 5.38.


leadingVisibleItem : Item [read-only, since 2.6]

This property holds the first page in the PageRow that is at least partially visible.

Note: Pages before that one (the one contained in the property) will be out of the viewport.

This property was introduced in 2.6.

See also ColumnView::leadingVisibleItem.


This property assigns a drawer as an internal left sidebar for this PageRow.

In this case, when open and not modal, the drawer contents will be in the same layer as the base pagerow. Pushing any other layer on top will cover the sidebar.

This property was introduced in 5.84.


popHiddenPages : bool [since 5.101]

This property holds whether to automatically pop pages at the top of the stack if they are not visible.

If a user navigates to a previous page on the stack (ex. pressing back button) and pages above it on the stack are not visible, they will be popped if this property is true.

This property was introduced in 5.101.


separatorVisible : bool [since 5.38]

This property sets whether the separators between pages should be displayed.

default: true

This property was introduced in 5.38.


trailingVisibleItem : Item [read-only, since 2.6]

This property holds the last page in the PageRow that is at least partially visible.

Note: Pages after that one (the one contained in the property) will be out of the viewport.

This property was introduced in 2.6.

See also ColumnView::trailingVisibleItem.


visibleItems : Page [read-only, since 2.6]

This property holds all visible pages in the PageRow, excluding those which are scrolled away.

This property was introduced in 2.6.


wideMode : bool [read-only, since 5.37]

This property tells whether the PageRow is wide enough to show multiple pages.

This property was introduced in 5.37.


Signal Documentation

[since 2.7] pageInserted(int position, Item page)

Emitted when a page has been inserted anywhere. position where the page has been inserted page the new page

Note: The corresponding handler is onPageInserted.

This signal was introduced in 2.7.


[since 2.5] pagePushed(Item page)

Emitted when a page has been pushed to the bottom. page the new page

Note: The corresponding handler is onPagePushed.

This signal was introduced in 2.5.


[since 2.5] pageRemoved(Item page)

Emitted when a page has been removed from the row. page the page that has been removed: at this point it's still valid, but may be auto deleted soon.

Note: The corresponding handler is onPageRemoved.

This signal was introduced in 2.5.


Method Documentation

void clear()

Clears the page stack.

Destroy (or reparent) all the pages contained.


void flickBack()

Go back to the previous index and scroll to the left to show one more column.


Page get(int idx)

idx the depth of the page we want

Returns the page at idx


void goBack(var event = null)

Acts as if you had pressed the "back" button on Android or did Alt-Left on desktop, "going back" in the layers and page row. Results in a layer being popped if available, or the currentIndex being set to currentIndex-1 if not available.

event Optional, an event that will be accepted if a page is successfully "backed" on


void goForward()

Acts as if you had pressed the "forward" shortcut on desktop, "going forward" in the page row. Results in the active page becoming the next page in the row from the current active page, i.e. currentIndex + 1.


[since 2.7] Page insertPage(int position, var page, var properties)

Inserts a new page or a list of new pages at an arbitrary position.

A single page can be defined as an url, a component, or an object. It can also be an array of the above said types, but in that case, the properties' array length must match pages' array length or it must be empty. Failing to comply with the following rules will make the method return null before doing anything.

page A single page or an array of pages.

properties A single property object or an array of property objects.

Returns the new created page (or the last one if it was an array).

This method was introduced in 2.7.


[since 2.7] void movePage(int fromPos, int toPos)

Move the page at position fromPos to the new position toPos If needed, currentIndex will be adjusted in order to keep the same current page.

This method was introduced in 2.7.


Page pop(var page)

Pops a page off the stack. page If page is specified then the stack is unwound to that page, to unwind to the first page specify page as null.

Returns the page instance that was popped off the stack.


Page push(var page, var properties)

This method pushes a page on the stack.

A single page can be defined as an url, a component, or an object. It can also be an array of the above said types, but in that case, the properties' array length must match pages' array length or it must be empty. Failing to comply with the following rules will make the method return null before doing anything.

page A single page or an array of pages.

properties A single property object or an array of property objects.

Returns The new created page (or the last one if it was an array).


Page pushDialogLayer(var page, var properties, var windowProperties)

Pushes a page as a new dialog on desktop and as a layer on mobile.

page A single page defined as either a string url, a component or an object (which will be reparented). The following page gains closeDialog() method allowing to make it indistinguishable to close/hide it when in desktop or mobile mode. Note that Kiriami supports calling closeDialog() only once.

properties The properties given when initializing the page.

windowProperties The properties given to the initialized window on desktop.

Returns a newly created page.


[since 2.7] Page removePage(var page)

Remove the given page.

page The page can be given both as integer position or by reference

Returns the page that has just been removed

This method was introduced in 2.7.


Page replace(var page, var properties)

Replaces a page on the current index.

A single page can be defined as an url, a component, or an object. It can also be an array of the above said types, but in that case, the properties' array length must match pages' array length or it must be empty. Failing to comply with the following rules will make the method return null before doing anything.

page A single page or an array of pages.

properties A single property object or an array of property objects.

Returns the new created page (or the last one if it was an array). See push() for details.