qt-bugs@ issue : N206173 Trolltech task ID : 206174 bugs.kde.org number : none applied: no author: Fredrik Höglund Calling data->mask() in a pixmap that has an alpha channel causes the mask to be generated from the alpha channel. This is a very expensive operation, and completely unecessary in this case since the generated bitmap is immediately discarded. Fix the issue by reversing the order of the tests in the return statement, so the function returns true if the pixmap has an alpha channel, without generating the mask. --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1661,7 +1661,7 @@ */ bool QPixmap::hasAlpha() const { - return (!data->mask().isNull() || data->hasAlphaChannel()); + return (data->hasAlphaChannel() || !data->mask().isNull()); } /*!