[Interest] iOS retina @3x

Robert Iakobashvili coroberti at gmail.com
Wed Aug 19 10:30:06 CEST 2015


On Wed, Aug 19, 2015 at 11:27 AM, Robert Iakobashvili
<coroberti at gmail.com> wrote:
> On Wed, Aug 19, 2015 at 11:08 AM, maitai <maitai at virtual-winds.org> wrote:
>> Hello,
>>
>> I am in the process of upgrading our icons to accommodate retina
>> display, especially on iOS.
>>
>> For this purpose, I have created artwork at different sizes, for
>> instance
>>
>> arrow_left.png (32x32)
>> arrow_left at 2x.png (64x64)
>> arrow_left at 3x.png (96x96)
>>
>> I changed the color of each image in order to see which one is actualy
>> loaded, and I do have
>> QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
>>
>> then I just use QIcon myIcon("arrow_left.png");
>>
>> When I run this on iPhone 6 emulator, I can see that the @2x is loaded
>> as expected, very nice. But when I do the same on iPhone 6+ emulator,
>> the @2x is loaded too, where I was expecting the @3x version to be
>> used... The system reports 3 for devicePixelRatio as expected, but still
>> qt is choosing the 2x version.
>>
>> So the question is: @3x is also supported for QIcon in qt 5.5.0/iOS or
>> it should work and I am doing something wrong?
>>
>> Thanks
>> Philippe Lelong
>
> Dear Phillippe,
> Welcome to the club.
>
> Doing that with the patch from Morten Sorvig applied for 5.4:
> https://codereview.qt-project.org/106717
>
> is working for me at a real device (6+) as well as at emulator
> for a QWidget-based app.
>
> I'm not trying 5.5 till 5.5.1
>
> Hope this helps.
>
> Regards,
> Robert

On iOS it's working for me at the patched 5.4.2 without setting
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);

Take care,
Robert



More information about the Interest mailing list