redically simplifying the code, port the ksplash kcm to the new design
- Group Reviewers
- R119:a6761883c8e7: port the ksplash kcm to the new design
selecting and preview work correctly, resize behavior is correct
the onCountChanged connection thinghie it's an hack that serves at startup: we don't have a signal from listview "i'm done populating" which happens way after component.oncompleted, so the only way we have is when the list gets populated, which also means that its contents grow in size.
*probably* i can remove onCurrentIndexChanged
You shouldn't have told me that :)
I have one consistent rule about working round Qt bugs, it needs an upstream report and a link in the code.
but in any case, your comment doesn't explain why we need:
If we've just changed the index, we'll run onCurrentIndexChanged which does it's own view.positionViewAt() .
Unless we need to position the view even when we don't change the index?
I am not completely sure is actually a Qt bug... not sure it would be possible to have some finished signal, as depending on how the model behaves, you can never be sure that the representation is "completed" as the model can change at any moment?
It must know internally as it has that separate populate and add transition.
It shouldn't need an external signal. In a perfect world:
model: someValidModel currentIndex: 4
should "just work"
annoyingly, you are right :p
now, loading the model in the ctor and just relying on one single binding for currentIndex works perfectly.
note: i removed onCurrentIndexChanged: positionViewAtIndex as i want to put it on the gridview kcm component itself, as i think it belongs there.