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 /examples/widgets/widgets/tablet | |
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 'examples/widgets/widgets/tablet')
-rw-r--r-- | examples/widgets/widgets/tablet/tabletcanvas.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/widgets/widgets/tablet/tabletcanvas.cpp b/examples/widgets/widgets/tablet/tabletcanvas.cpp index 9215d5b10c..e397d70cd6 100644 --- a/examples/widgets/widgets/tablet/tabletcanvas.cpp +++ b/examples/widgets/widgets/tablet/tabletcanvas.cpp @@ -133,7 +133,7 @@ void TabletCanvas::tabletEvent(QTabletEvent *event) //! [4] void TabletCanvas::initPixmap() { - qreal dpr = devicePixelRatioF(); + qreal dpr = devicePixelRatio(); QPixmap newPixmap = QPixmap(qRound(width() * dpr), qRound(height() * dpr)); newPixmap.setDevicePixelRatio(dpr); newPixmap.fill(Qt::white); @@ -149,8 +149,8 @@ void TabletCanvas::paintEvent(QPaintEvent *event) if (m_pixmap.isNull()) initPixmap(); QPainter painter(this); - QRect pixmapPortion = QRect(event->rect().topLeft() * devicePixelRatioF(), - event->rect().size() * devicePixelRatioF()); + QRect pixmapPortion = QRect(event->rect().topLeft() * devicePixelRatio(), + event->rect().size() * devicePixelRatio()); painter.drawPixmap(event->rect().topLeft(), m_pixmap, pixmapPortion); } //! [4] |