[Qt-qml] Problem with BorderImage & QDeclarativeImageProvider (4.7.1)
Timo.Rouvinen at nokia.com
Timo.Rouvinen at nokia.com
Tue Dec 28 07:55:29 CET 2010
Hey,
>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?
I am rendering SVGs on my imageprovider and I would need to know the size to which I am rendering to.
>I recently made some changes which made this property read-only for BorderImage and added some documentation to reflect this. I imagine it will turn up in future versions.
Ok, if it is read-only how is the value of sourceSize determined?
Br,
Timo
From: Kennedy Aaron (Nokia-MS-Qt/Brisbane)
Sent: 24.12.2010 01:55
To: Rouvinen Timo (Nokia-MS/Tampere)
Cc: <qt-qml at qt.nokia.com>
Subject: Re: [Qt-qml] Problem with BorderImage & QDeclarativeImageProvider (4.7.1)
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/20101228/28301793/attachment.html
More information about the Qt-qml
mailing list