D28468: Add property initializer support to PagePool
Mason McParlane
noreply at phabricator.kde.org
Tue Mar 31 19:10:56 BST 2020
masonm created this revision.
masonm added reviewers: Kirigami, mart.
Herald added a project: Kirigami.
masonm requested review of this revision.
REVISION SUMMARY
Currently PagePool allows pages to be pushed onto the stack but there
is no way to pass initialization properties to the newly-created
page. This change adds support for this, and also provides
asynchronous object creation to speed things up a bit.
TEST PLAN
After running the following main.qml the page stack will first
push a page with the default title "NO PROPERTIES" because it
invokes the no-property behavior. Afterward the same page gets
pushed on the stack but this time it sets the title to
"PROPERTIES" using the passed-in properties object.
// main.qml
Kirigami.ApplicationWindow {
id: window
Kirigami.PagePool {
id: pool
}
Kirigami.PagePoolAction {
id: noprops
text: "Action with props"
pagePool: pool
pageStack: window.pageStack
page: "qrc:/TestPage.qml?hasProps=" + false
}
Kirigami.PagePoolAction {
id: props
text: "Action with props"
pagePool: pool
pageStack: window.pageStack
page: "qrc:/TestPage.qml?hasProps=" + true
properties: { title: "PROPERTIES" }
}
Component.onCompleted: {
noprops.trigger()
props.trigger()
}
}
// TestPage.qml
Kirigami.Page {
title: "NO PROPERTIES"
}
REPOSITORY
R169 Kirigami
BRANCH
add-pagepool-properties (branched from master)
REVISION DETAIL
https://phabricator.kde.org/D28468
AFFECTED FILES
src/controls/PagePoolAction.qml
src/pagepool.cpp
src/pagepool.h
To: masonm, #kirigami, mart
Cc: plasma-devel, mart, fbampaloukas, GB_2, domson, dkardarakos, ngraham, apol, ahiemstra, davidedmundson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200331/990324e3/attachment.html>
More information about the Plasma-devel
mailing list