[Qt-qml] Problem with BorderImage & QDeclarativeImageProvider (4.7.1)

aaron.kennedy at nokia.com aaron.kennedy at nokia.com
Fri Dec 24 00:54:30 CET 2010


Hi,

On 23/12/2010, at 8:04 PM, ext Timo.Rouvinen at nokia.com<mailto:Timo.Rouvinen at nokia.com> wrote:

Hello!

I’ve implemented an image provider (requestPixmap()) and trying to use QML BorderImage with it. Everything works otherwise OK except that the requestedSize is always -1,-1. My BorderImage does have width and height set, and additionally I’ve also tried setting the sourceSize but still the requestedSize coming to the image provider is always invalid.

Debugging the problem further I noticed the qdeclarativeborderimage.cpp calls load like this:

d->pix.load(qmlEngine(this), d->url, d->async);

So it calls the version that doesn’t give any size to the load() method… I tried changing  the load to have the sourceSize as a parameter (and built Qt Declarative):

d->pix.load(qmlEngine(this), d->url, d->sourcesize, d->async);

.. then it seemed to work as expected.

BorderImage documentation does not mention the sourceSize as a property whereas QML Image does… Should the QML BorderImage use the sourceSize property similarly as QML Image does?

As an implementation detail, BorderImage does have the sourceSize property but, as you observed, it just ignores it.  We could modify BorderImage to respect the property, but I can't think of an actual use for it.  Why do you want this behavior?

Cheers,

Aaron

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


More information about the Qt-qml mailing list