mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 17: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.
|
//some icon is very large ,will crash the application.
|
||||||
img = img.scaledToWidth( 48 );
|
img = img.scaledToWidth( 48 );
|
||||||
// Apply the color key
|
// Apply the color key
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
|
||||||
img.setAlphaChannel( img.createMaskFromColor( QColor( 192, 192, 192 ).rgb(),
|
img.setAlphaChannel( img.createMaskFromColor( QColor( 192, 192, 192 ).rgb(),
|
||||||
Qt::MaskOutColor ) );
|
Qt::MaskOutColor ) );
|
||||||
|
#endif
|
||||||
|
|
||||||
dictionaryNativeIcon = QIcon( QPixmap::fromImage( img ));
|
dictionaryNativeIcon = QIcon( QPixmap::fromImage( img ));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue