-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[MRG+1] Use svg file for applicaiton icon on qt5 #8669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I suspect that this is not an issue, but how far back does Qt support svg icons like this? We just had two big breaks with Qt4 (the device dpi issue in 2.0.1 and a unicode issue (that I think is only on master?)) so I am extra nervous about that. |
It looks like it was supported in Qt 5.6: https://doc.qt.io/qt-5.6/qimagereader.html#supportedImageFormats, but I can't find any references in the 5.5 docs |
The note here says that the SVG icon engine was added in Qt 4.2. |
@dstansby can you wrap this is a try-except ? |
How old a Qt do we support? |
Oh, never mind, we document only supporting >= 4.4 ! |
Er, pyqt 4.4, |
I am completely failing to find any Qt version information in the PyQt docs. I am inclined to add the try...except, it is probably less work than trying to sort out if this is safe on all supported versions. |
Based on this thread, theoretically any version of PyQt4 should work with any version of Qt and should at least support all the features up to the corresponding version, though I'd assume that some of the new features in Qt might not be available in older PyQt4. So I guess we'd only need to check for exceptions wrt older Qt not supporting SVG (not any problems in PyQt4 itself), though I'm not sure what sort of exception it would be. |
Would it be okay to just catch any exception? |
I'm not even sure if this will raise anything. I tried converting the file to PSD and passing that in, but you just end up with a generic icon instead of an error. Don't know if this applies to older versions as I don't really have any way to try them out. |
Hmm, maybe a compromise would be to add a high res .png file. |
I think instead of passing a |
http://doc.qt.io/qt-5/qicon.html states
Qt4.2 was released in 2006 (https://en.wikipedia.org/wiki/Qt_version_history#Qt_4) so if anyone complains I'd just update the minimum supported Qt version to 4.2 and call it a day. |
Currently QT5 uses a low resolution .png for the application icon; this uses the .svg instead which looks way better (top is svg, bottom is png):