Solved QSystemTrayIcon is blurred if it's not square
-
I'm trying to make a system tray icon from text info.
If I set the image size to 22x22 the text is ok, if I set it to 44x22(which is what I desire) the text goes blurry.
I have tried changing the font size and devicePixelRatio but nothing solves, I also tried making it from 2 images of size 22x22(both scaled and unscaled with KeepAspectRation).This is the code:
QImage image(44, 22, QImage::Format_ARGB32_Premultiplied); image.fill(QColor(0,0,0,0)); QPainter painter(&image); painter.setPen(QColor(Qt::white)); painter.drawText(QRect(22, 0, 22, 22), Qt::AlignRight, weather);
I also tried changing the image format. Anyone knows what's the issue?
-
Hi,
The issue comes from your expectation, QSystemTrayIcon uses square icons, see here.
-
@SGaist said in QSystemTrayIcon is blurred if it's not square:
Hi,
The issue comes from your expectation, QSystemTrayIcon uses square icons, see here.
Hi SGaist,
Isn't there a way to make rectangular icons like I've seen on other applications, somehow?(which aren't written in Qt)
-
@adutzu89 said in QSystemTrayIcon is blurred if it's not square:
Isn't there a way to make rectangular icons
Windows (7) only supports square ones so I don't think it's possible to have cross platform support for such a feature
-
@VRonin said in QSystemTrayIcon is blurred if it's not square:
@adutzu89 said in QSystemTrayIcon is blurred if it's not square:
Isn't there a way to make rectangular icons
Windows (7) only supports square ones so I don't think it's possible to have cross platform support for such a feature
I see, thank you.