[Qt-qml] QML Component Snapshot / Cover-Flow (PathView)implementation suggestions

jevon.beckles at orange-ftgroup.com jevon.beckles at orange-ftgroup.com
Thu Nov 18 10:07:21 CET 2010


Hello Michael,

 

The scrolling performance is indeed hindered by creating new delegates
as the path moves. This has been verified by using the Loader since
there is a notable pause at the time when switching between heavy and
light components (the switching logic is actually more complex than the
example given). I'm not sure how much painting/rendering affects the
performance, but if I use the heavy component, I would need to clip the
bounding rectangle (which further decreases performance according to the
documentation).

 

I was hoping to take a snapshot once and then save to disk (at least for
now). Ideally, I would have liked to generate the images on the fly, but
I accept that this may prove to be more difficult. 

 

Thanks for your help.

 

Regards,

Jevon

________________________________

From: michael.brasser at nokia.com [mailto:michael.brasser at nokia.com] 
Sent: 18 November 2010 04:21
To: BECKLES Jevon RD-ILAB-LON
Cc: qt-qml at trolltech.com
Subject: Re: [Qt-qml] QML Component Snapshot / Cover-Flow
(PathView)implementation suggestions

 

Hi,

 

Have you verified that the slowdown is primarily from painting (and not,
for example, from instantiating new delegates as the path moves)? Were
you hoping to generate the images on the fly, every time, or were you
planning to e.g. take a snapshot once and then save to disk?

 

There's no built-in QML-based way to take snapshots -- you'd need a
custom C++ component to do something like this (it does seem to be a
frequent request; has anyone else made a component for this already?).

 

Regards,

Michael

 

On 18/11/2010, at 12:39 AM, ext jevon.beckles at orange-ftgroup.com wrote:





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

 

<ATT00001..txt>

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20101118/6f9a2315/attachment.html 


More information about the Qt-qml mailing list