[Development] The behaviour of Image / image provider are different from 5.5.1 to 5.6 in iOS
ekke
ekke at ekkes-corner.org
Mon Apr 11 14:19:32 CEST 2016
Am 11.04.16 um 14:07 schrieb Ben Lau:
>
> On 11 April 2016 at 19:59, ekke <ekke at ekkes-corner.org
> <mailto:ekke at ekkes-corner.org>> wrote:
>
> Am 11.04.16 um 12:38 schrieb Ben Lau:
>> Hi,
>>
>> I am writing an image provider that read all the images to memory
>> at startup. And I found that the behaviour is different from
>> 5.5.1 to 5.6 in iOS. Seems that it is undocumented. I wonder is
>> it an expected behaviour or a bug?
>>
>> That is the example project:
>> https://github.com/benlau/quickcross/tree/master/tests/imageprovider
>>
>> That is the code of my image provider:
>>
>> QImageQCImageProvider::requestImage(constQString&id,QSize*size,c
>> onstQSize&requestedSize)
>> {
>> Q_UNUSED(requestedSize);
>> QCImageLoader*loader=QCImageLoader::instance();
>> QImageresult;
>> if(loader->contains(id)){
>> result=loader->image(id);
>> *size=result.size();
>> }
>> returnresult;
>> }
>> Code to display image:
>> Image {
>> id: image
>> source: "image://arts/Lenna.png" // An 512x512 image
>> }
>> In Qt 5.5.1 with iPhone6, the property of image will be set to:
>> width: 512
>> height: 512
>> sourceSize: Qt.size(512,512)
>> However, in Qt 5.6 with iPhone6, it becomes:
>> width: 170.66666
>> height: 170.66666
>> sourceSize: Qt.size(512,512)
>> The display size of image is different.
>>
>>
> now from Qt 5.6 HighDPI is supported for all platforms.
> iPhone has scaling factor 3
>
> 170.66666 * 3 = 512
>
>
> ekke
>
>
> But Qt 5.5 on iOS also support HighDPI. Their result are different.
>
>
have you tried to explicitely set
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
ekke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20160411/e28ed73f/attachment.html>
More information about the Development
mailing list