PageStack and StackView

Kai Uwe Broulik kde at privat.broulik.de
Mon Nov 24 19:17:59 UTC 2014


Hi again,

I was looking into porting PlasmaComponents.PageStack to 
QtQuick.Controls.StackView. PageStack provides quite some legacy features 
Marco told me weren't that important but it also has a lot of similar-but-
different API with JavaScript functions taking a couple of parameters whereas 
Qt takes one JS Object and I think we cannot overload them (ie. have a method 
foo(bar, baz) call a foo(bla) instead.

API differences (PageStack → StackView)
depth → depth (identical)
currentPage → currentItem (could be alias'd)
toolBar → for some magic toolbar thing, allegedly used in the widget gallery
animate → there's an "immediate" property for pushing/popping items, our 
StackViewDelegate could honor that/the duration settings
initialPage → initialItem
busy → busy (identical)
push(page, properties, immediate) → push(item) as a shortcut, or push({item: 
someItem, immediate: true, properties: {foo: "bar", baz: "bla"} }) which 
cannot be (easily, if at all?) overloaded to provide legacy support
pop(page, immediate) → pop(null), pop(item), or pop({item: item, immediate: 
true})
replace(page, properties, immediate) → push({item: item, replace: true, ...})
clear() → clear() (identical)
find(func) → find(func, onlySearchLoadedItems) (compatible)

There's also a CodeReview [1] which hopefully soon[tm] allow the use of 
Animators for the StackViewDelegate reducing the stutter we currently have 
when eg. switching between systray items. I tried in one of my apps and the 
results were stunning, really.

Due to the invasive API differences I was thinking of keeping the PageStack as 
is, deprecated, and add a new PlasmaComponents.StackView with all the new 
fancy QQC API.

Thoughts?

Cheers,
Kai Uwe

[1] https://codereview.qt-project.org/#/c/100657/



More information about the Plasma-devel mailing list