> Your code looks ok. You didn't say what the problem was?

You're right, I'm sorry for that. As you can see in the attached screenshot, 
the @2x icon is not actually used in a high DPI/DPR application:

    QPushButton* pbCustom = new QPushButton();
    pbCustom->setText(tr("QPushButton w/ pixmap"));
    pbCustom->setIcon(pixmap);
    pbCustom->setIconSize(QSize(48, 48));
    // ...

    QPushButton* pbCustom2x = new QPushButton();
    pbCustom2x->setText(tr("QPushButton w/ pixmap2x"));
    pbCustom2x->setIcon(pixmap2x);
    pbCustom2x->setIconSize(QSize(48, 48));
    // ...

This is with QT_DEVICE_PIXEL_RATIO set to both '2' and 'auto'. 

>> QPixmap pixmap2x(":/icons/48x48/i...@2x.png");
>> pixmap2x.setDevicePixelRatio(2);
> You don't need to set the DPR manually, QPixmap will set it when it sees the 
> @2x in the filename.

That's what I figured out after sending my mail. Thanks anyway!

Best regards,
Julius
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to