Add property initializer support to PagePool
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"
}
Reviewers: Kirigami, mart
Reviewed By: Kirigami, mart
Subscribers: plasma-devel, mart
Tags: Kirigami
Differential Revision: https://phabricator.kde.org/D28468