Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
QBitmap &QBitmap::operator=(const QPixmap &pixmap)
{
- 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
- }
+ *this = fromImage(pixmap.toImage());
return *this;
}