mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-25 11:22:58 +00:00
avoid temporary in QBitmap::operator=()
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
f5af31d53f
commit
4c06eda33c
1 changed files with 1 additions and 2 deletions
|
@ -190,8 +190,7 @@ QBitmap &QBitmap::operator=(const QPixmap &pixmap)
|
||||||
} else if (pixmap.depth() == 1) { // 1-bit pixmap
|
} else if (pixmap.depth() == 1) { // 1-bit pixmap
|
||||||
QPixmap::operator=(pixmap); // shallow assignment
|
QPixmap::operator=(pixmap); // shallow assignment
|
||||||
} else { // n-bit depth pixmap
|
} else { // n-bit depth pixmap
|
||||||
QImage image = pixmap.toImage(); // convert pixmap to image
|
*this = fromImage(pixmap.toImage()); // convert pixmap to image and dither
|
||||||
*this = fromImage(image); // will dither image
|
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue