Unsolved QPixmap Quality MacOS/Linux/Windows
-
Hello,
I use the option
qApp->setAttribute(Qt::AA_UseHighDpiPixmaps);
In order to obtain the best possible pixmaps, especially when scaling images.
Under MacOS the images look very good (48x48px scaled to 16x16px or 32x32px). In the screenshot below you can see it
On Linux and Windows, they look very bad, as if they had dragged them with paintbrush.
Is there another option, which works as under MacOS?
Withpstar = pstar.scaled(QSize(16,16),Qt::AspectRatioMode::KeepAspectRatio,Qt::SmoothTransformation);
they looks under Linux better, but under MacOS bad :)
They are drawn on QAbstractItemDelegate paint event by
r = option.rect.adjusted (imageSpace, 0, 0, 0); r.setSize (Qsize (16,16)); QPixmap pstar; pstar.load ( ":/smallimages/images32/star.png"); Painter> drawPixmap (r, pstar);
-
Hi,
What size are your icons ?
-
@SGaist Currently 48x48px, tested with 64x64px with same results.
Onlypstar = pstar.scaled(QSize(16,16),Qt::AspectRatioMode::KeepAspectRatio,Qt::SmoothTransformation);
helped under Windows and Linux. But is not very beautiful, blurr quality.
-
And what is the image original size ?
-
@SGaist The original size are 48x48px
With SmoothTransformation i get better results, only on MacOS the quality looks perfect.