mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
fix:if the applciation has a very large icon ,the application will crash
This commit is contained in:
parent
a4c1e2793a
commit
0ea3ad0149
|
@ -243,12 +243,14 @@ bool Class::loadIconFromFile( QString const & _filename, bool isFullName )
|
|||
{
|
||||
// Load successful
|
||||
|
||||
//some icon is very large ,will crash the application.
|
||||
img = img.scaledToWidth( 48 );
|
||||
// Apply the color key
|
||||
|
||||
img.setAlphaChannel( img.createMaskFromColor( QColor( 192, 192, 192 ).rgb(),
|
||||
Qt::MaskOutColor ) );
|
||||
|
||||
dictionaryNativeIcon = QIcon( QPixmap::fromImage( img ) );
|
||||
dictionaryNativeIcon = QIcon( QPixmap::fromImage( img ));
|
||||
|
||||
// Transform it to be square
|
||||
int max = img.width() > img.height() ? img.width() : img.height();
|
||||
|
|
Loading…
Reference in a new issue