Unsolved Question about QCursor constructor
-
QCursor::QCursor(const QPixmap &pixmap, int hotX, int hotY) : d(0) { QImage img = pixmap.toImage().convertToFormat(QImage::Format_Indexed8, Qt::ThresholdDither|Qt::AvoidDither); QBitmap bm = QBitmap::fromImage(img, Qt::ThresholdDither|Qt::AvoidDither); QBitmap bmm = pixmap.mask(); if (!bmm.isNull()) { QBitmap nullBm; bm.setMask(nullBm); } else if (!pixmap.mask().isNull()) { QImage mimg = pixmap.mask().toImage().convertToFormat(QImage::Format_Indexed8, Qt::ThresholdDither|Qt::AvoidDither); bmm = QBitmap::fromImage(mimg, Qt::ThresholdDither|Qt::AvoidDither); } else { bmm = QBitmap(bm.size()); bmm.fill(Qt::color1); } d = QCursorData::setBitmap(bm, bmm, hotX, hotY, pixmap.devicePixelRatio()); d->pixmap = pixmap; }
Dose the conditional branch
if
andelse if
test same case?? -
yes. The are same. What is the issue you are facing ?
-
Thanks for your reply.
Just questioning the logic of this code, and curious why it has not been fixed. -
@lniwn said in Question about QCursor constructor:
if (!bmm.isNull()) {
I would guess the '!' is wrong here. Please create a bug report and post the bug number here. Thx.