PlasmaComponents

Public Member Functions | |
void | clear () |
Page | find (function func) |
Page | pop (Page page, bool immediate) |
Page | push (variant page, dict properties, bool immediate) |
Page | replace (variant page, dict properties, bool immediate) |
Properties | |
bool | busy |
Item | currentPage |
int | depth |
variant | initialPage |
ToolBar | toolBar |
Detailed Description
The PageStack component provides a stack-based navigation model that you can use in your application.
- Since
- 0.1 A stack-based navigation model means that a page of content for your application is pushed onto a stack when the user navigates deeper into the application page hierarchy. The user can then go back to the previous page (or several pages back) by popping a page (or several pages) off the top of the stack.
Definition at line 54 of file PageStack.qml.
Member Function Documentation
void PageStack::clear | ( | ) |
Clears the page stack of all pages.
Page PageStack::find | ( | function | func | ) |
Iterates through all pages (top to bottom) and invokes the specified function.
If the specified function returns true the search stops and the find function returns the page that the iteration stopped at. If the search doesn't result in any page being found then null is returned.
- Parameters
-
func the function to call
- Returns
- the found page or null
Pops a page off the stack.
- Parameters
-
page if page is specified then the stack is unwound to that page, to unwind to the first page specify page as null. immediate set to true to disable transition animations
- Returns
- the page instance that was popped off the stack.
Page PageStack::push | ( | variant | page, |
dict | properties, | ||
bool | immediate | ||
) |
Pushes a page on the stack.
The page can be defined as a component, item or string. If an item is used then the page will get re-parented. If a string is used then it is interpreted as a url that is used to load a page component.
The page can also be given as an array of pages. In this case all those pages will be pushed onto the stack. The items in the stack can be components, items or strings just like for single pages. Additionally an object can be used, which specifies a page and an optional properties property. This can be used to push multiple pages while still giving each of them properties. When an array is used the transition animation will only be to the last page.
Note: When the stack is empty, a push() or replace() does not perform a transition animation because there is no page to transition from. The only time this normally happens is when an application is starting up so it is not appropriate to have a transition animation anyway.
- Parameters
-
page the page to push properties optional argument to define a map of properties to set on the page. immediate set to true to disable transition animations
- Returns
- the page instance.
Page PageStack::replace | ( | variant | page, |
dict | properties, | ||
bool | immediate | ||
) |
Replaces the top-most page on the stack with page.
As in the push() operation, you can use a component, item or string for the page, or even an array of pages. If the page is based on the Item element, the page is re-parented. As in the pop() operation, the replaced page on the stack is re-parented back to its original parent.
- Parameters
-
page the page to push properties optional argument to define a map of properties to set on the page. immediate set to true to disable transition animations
- Returns
- The new top page on the stack.
Property Documentation
bool PageStack::busy |
Indicates whether there is an ongoing page transition.
Definition at line 76 of file PageStack.qml.
Item PageStack::currentPage |
The page in the stack that is currently visible.
Definition at line 59 of file PageStack.qml.
int PageStack::depth |
The number of pages on the page stack.
Definition at line 57 of file PageStack.qml.
variant PageStack::initialPage |
The page to be automatically loaded when this PageStack component gets instantiated.
Definition at line 74 of file PageStack.qml.
ToolBar PageStack::toolBar |
The toolbar container for the tools associated with each page.
If a toolbar is specified, the tools set for the current page is shown to the user.
If toolbar is null, then no tools are shown even if a page does have tools.
Definition at line 69 of file PageStack.qml.
The documentation for this class was generated from the following file:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:08:40 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.