mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
certain image will cause application to crash
related to qtbug https://bugreports.qt.io/browse/QTBUG-105265
This commit is contained in:
parent
277b90657d
commit
25c9c38e96
|
@ -246,9 +246,10 @@ bool Class::loadIconFromFile( QString const & _filename, bool isFullName )
|
|||
//some icon is very large ,will crash the application.
|
||||
img = img.scaledToWidth( 48 );
|
||||
// Apply the color key
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
|
||||
img.setAlphaChannel( img.createMaskFromColor( QColor( 192, 192, 192 ).rgb(),
|
||||
Qt::MaskOutColor ) );
|
||||
#endif
|
||||
|
||||
dictionaryNativeIcon = QIcon( QPixmap::fromImage( img ));
|
||||
|
||||
|
|
Loading…
Reference in a new issue