mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
Revert "fix recursion in case QBitmap is constructed with null pixmap"
This reverts commit 66f787ee62
.
This commit is contained in:
parent
a171ef7d91
commit
d7d4e5fda1
1 changed files with 10 additions and 1 deletions
|
@ -192,7 +192,16 @@ QBitmap::QBitmap(const QString& fileName, const char *format)
|
|||
|
||||
QBitmap &QBitmap::operator=(const QPixmap &pixmap)
|
||||
{
|
||||
*this = fromImage(pixmap.toImage());
|
||||
if (pixmap.isNull()) { // a null pixmap
|
||||
QBitmap bm(0, 0);
|
||||
QBitmap::operator=(bm);
|
||||
} else if (pixmap.depth() == 1) { // 1-bit pixmap
|
||||
QPixmap::operator=(pixmap); // shallow assignment
|
||||
} else { // n-bit depth pixmap
|
||||
QImage image;
|
||||
image = pixmap.toImage(); // convert pixmap to image
|
||||
*this = fromImage(image); // will dither image
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue