The reason for QDeclarativeImageProvider is that there are memory management 
issues with QPixmap and javascript.  JS doesn't know how much memory a QPixmap 
actually consumes; it just has a handle to the data.  This means that the gc 
does not get run as often as you'd like to delete the pixmaps.  Of course 
pixmap data is shared, so it's not so simple to handle this as you would 
initially think.  We will add a means to deal with this in a later version of 
QML, but for now QDeclarativeImageProvider is the solution.

Br,
Martin.

> -----Original Message-----
> From: ext Girish Ramakrishnan [mailto:[email protected]]
> Sent: Friday, 29 April 2011 10:41 AM
> To: Jones Martin (Nokia-SD-Qt/Brisbane); [email protected]
> Cc: [email protected]
> Subject: Re: [Qt-qml] How to use decoration role data in QML?
> 
> I created http://bugreports.qt.nokia.com/browse/QTBUG-18908 a couple
> of days back which is related to this.
> 
> Girish
> 
> On Fri, Apr 29, 2011 at 5:12 AM,  <[email protected]> wrote:
> > Hi,
> >
> > You need to use a QDeclarativeImageProvider to provide the pixmap:
> > http://doc.qt.nokia.com//4.7-snapshot/qdeclarativeimageprovider.html
> >
> > Br,
> > Martin.
> >
> >> -----Original Message-----
> >> From: [email protected] [mailto:qt-qml-
> >> [email protected]] On Behalf Of ext Alan Ezust
> >> Sent: Friday, 29 April 2011 3:33 AM
> >> To: [email protected]
> >> Subject: [Qt-qml] How to use decoration role data in QML?
> >>
> >> In the QML docs for QML data models, it says that
> >> "Qt::DecorationRole" is exposed as a property "decoration" from the 
> >> delegate.
> >> If I return a QPixmap from C++ via that role, how do I use it in QML?
> >> If I have an Image { source: } item, I need a URL property, not a QPixmap.
> >> Is there a way to get the URL from the pixmap, or is there some other
> >> trick to telling the Image {} to display decoration role data?
> >> _______________________________________________
> >> Qt-qml mailing list
> >> [email protected]
> >> http://lists.qt.nokia.com/mailman/listinfo/qt-qml
> > _______________________________________________
> > Qt-qml mailing list
> > [email protected]
> > http://lists.qt.nokia.com/mailman/listinfo/qt-qml
> >
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml

Reply via email to