-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
None
-
5.8.0
-
None
-
Windows 10, Qt 5.8
When set new bitmap cursor for widget:
Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); QBitmap cursorb(16, 16); cursorb.clear(); { QPainter cpainter(&cursorb); cpainter.setPen(Qt::color1); cpainter.drawLine(7, 0, 7, 14); cpainter.drawLine(0, 7, 14, 7); } QCursor m_plotCursor = QCursor(cursorb, cursorb, 7, 7); setCursor(m_plotCursor); }
It is look ugly with HighDPI set.
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
I think that bug in this code (qwindowscursor.cpp):
static HCURSOR createBitmapCursor(const QCursor &cursor, qreal scaleFactor = 1) { ..... if (!qFuzzyCompare(scaleFactor, 1)) { const QSize scaledSize = (QSizeF(bbits.size()) * scaleFactor).toSize(); bbits = bbits.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); mbits = mbits.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); } ... }
Bug appear when resizing monochrome bitmap with Qt::SmoothTransformation.