diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2020-09-01 13:45:24 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2020-09-10 17:28:11 +0200 |
commit | b3c991ae8f9da6d8eb26f10b3d4ab08587588c9e (patch) | |
tree | 8f2ff32cadf9b8733701b8f99229a6135f53f7d7 /tests/manual | |
parent | e1ce78d48498a3de21fe4714e92e2c0fcf1a0813 (diff) |
Port from devicePixelRatioF() to devicePixelRatio()
This ports all of QtBase.
Change-Id: If6712da44d7749b97b74f4614a04fac360f69d9e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'tests/manual')
-rw-r--r-- | tests/manual/diaglib/qwidgetdump.cpp | 2 | ||||
-rw-r--r-- | tests/manual/highdpi/dragwidget.cpp | 4 | ||||
-rw-r--r-- | tests/manual/highdpi/main.cpp | 2 | ||||
-rw-r--r-- | tests/manual/widgets/styles/main.cpp | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/tests/manual/diaglib/qwidgetdump.cpp b/tests/manual/diaglib/qwidgetdump.cpp index 21007e8df9..b1d2a37d0e 100644 --- a/tests/manual/diaglib/qwidgetdump.cpp +++ b/tests/manual/diaglib/qwidgetdump.cpp @@ -100,7 +100,7 @@ static void dumpWidgetRecursion(QTextStream &str, const QWidget *w, if (w->isWindow()) { str << ' ' << w->logicalDpiX() << "DPI"; #if QT_VERSION > 0x050600 - const qreal dpr = w->devicePixelRatioF(); + const qreal dpr = w->devicePixelRatio(); if (!qFuzzyCompare(dpr, qreal(1))) str << " dpr=" << dpr; #endif // Qt 5.6 diff --git a/tests/manual/highdpi/dragwidget.cpp b/tests/manual/highdpi/dragwidget.cpp index 674b2e6a0d..bd65fcf81b 100644 --- a/tests/manual/highdpi/dragwidget.cpp +++ b/tests/manual/highdpi/dragwidget.cpp @@ -162,8 +162,8 @@ void DragWidget::mousePressEvent(QMouseEvent *event) mimeData->setData("application/x-hotspot", QByteArray::number(hotSpot.x()) + ' ' + QByteArray::number(hotSpot.y())); - const qreal dpr = devicePixelRatioF() > 1 && !(QGuiApplication::keyboardModifiers() & Qt::ShiftModifier) - ? devicePixelRatioF() : 1; + const qreal dpr = devicePixelRatio() > 1 && !(QGuiApplication::keyboardModifiers() & Qt::ShiftModifier) + ? devicePixelRatio() : 1; QPixmap pixmap(child->size() * dpr); pixmap.setDevicePixelRatio(dpr); diff --git a/tests/manual/highdpi/main.cpp b/tests/manual/highdpi/main.cpp index 883dd5a226..18c29bd9af 100644 --- a/tests/manual/highdpi/main.cpp +++ b/tests/manual/highdpi/main.cpp @@ -1293,7 +1293,7 @@ QT_DPI_ADJUSTMENT_POLICY=AdjustDpi|DontAdjustDpi|AdjustUpOnly)"; << "\n\n"; } - str << "widget devicePixelRatio: " << this->devicePixelRatioF() + str << "widget devicePixelRatio: " << this->devicePixelRatio() << "\nwidget logicalDpi: " << this->logicalDpiX() << "\n\nQT_FONT_DPI: " << qgetenv("QT_FONT_DPI") << "\nQT_SCALE_FACTOR: " << qgetenv("QT_SCALE_FACTOR") diff --git a/tests/manual/widgets/styles/main.cpp b/tests/manual/widgets/styles/main.cpp index a2b4ff8228..be8f3e3cd5 100644 --- a/tests/manual/widgets/styles/main.cpp +++ b/tests/manual/widgets/styles/main.cpp @@ -286,7 +286,7 @@ void MainWindow::updateDescription() QString text; QTextStream str(&text); str << "Qt " << QT_VERSION_STR << ", platform: " << QGuiApplication::platformName() - << ", Style: \"" << style()->objectName() << "\", DPR=" << devicePixelRatioF() + << ", Style: \"" << style()->objectName() << "\", DPR=" << devicePixelRatio() << ' ' << logicalDpiX() << ',' << logicalDpiY() << "DPI"; if (const QWindow *w = windowHandle()) str << ", Screen: \"" << w->screen()->name() << '"'; |