[Qt-qml] QML Component Snapshot / Cover-Flow (PathView) implementation suggestions
jevon.beckles at orange-ftgroup.com
jevon.beckles at orange-ftgroup.com
Wed Nov 17 15:39:35 CET 2010
Hello,
I'm trying to make a Cover Flow using a PathView. Ideally, the delegate
is a heavy/complex user-defined component (intended for user
interaction) but this affects the scrolling performance (scrolling is
not directly done by user interaction with PathView). Only the
current-index delegate is available for user interaction at any given
time.
As a work around, I've replaced the delegate with a Loader to load the
heavy component only when I'm not scrolling (see code snippet below). I
want to take a snapshot of my complex component and save it as an image
(or Pixmap or other light resource) to use for my light component. Is
there an easy way to do this? If not, is there an easy way or another
way to improve the performance of the PathView scrolling?
PathView{
property variant dataModel: myModel
property bool readyToScroll: false
id: coverFlow
width: 360
height: 540
pathItemCount: 3
preferredHighlightBegin: 0.5
preferredHighlightEnd: 0.5
interactive: false
path: Path {
id: myPath
// path definition
}
model: dataModel
delegate: Loader{
id: delLoader
width: coverFlow.width
height: coverFlow.height
sourceComponent: (readyToScroll) ? lightComponent :
heavyComponent
}
Component{
id: heavyComponent
Rectangle {
// heavy component definition
}
}
Component{
id: lightComponent
Image{
source: // snapshot image of heavy component
}
}
}
Regards,
Jevon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20101117/a63798ba/attachment.html
More information about the Qt-qml
mailing list