diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2020-08-11 21:11:24 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2020-08-29 12:42:32 +0200 |
commit | 5911335756dff5a917e4a7ccf025816c08ddd656 (patch) | |
tree | 43e63282bbd8eb455a22eeae1caeb16cbce6fcb0 /src/widgets/widgets/qlineedit_p.cpp | |
parent | 1719be99a711ff3223779bc90f009c60ece1328c (diff) |
Port QtBase to the new QIcon::pixmap() API
The target devicePixelRatio can now be passed to the
pixmap() function, instead of a QWindow pointer.
This allows us to remove some usage of the QWidget pointer
in the styles, since the DPR is accessible from the passed
in painter. The QWidget pointer is still used in places where
we don't have a painter.
Task-number: QTBUG-85885
Change-Id: Ifecc669f5bad655e289a936d71bafe02605f21a4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/widgets/widgets/qlineedit_p.cpp')
-rw-r--r-- | src/widgets/widgets/qlineedit_p.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index 05b14b1007..9fe5b5af3f 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -355,14 +355,13 @@ QLineEditPrivate *QLineEditIconButton::lineEditPrivate() const void QLineEditIconButton::paintEvent(QPaintEvent *) { QPainter painter(this); - QWindow *window = qt_widget_private(this)->windowHandle(QWidgetPrivate::WindowHandleMode::Closest); QIcon::Mode state = QIcon::Disabled; if (isEnabled()) state = isDown() ? QIcon::Active : QIcon::Normal; const QLineEditPrivate *lep = lineEditPrivate(); const int iconWidth = lep ? lep->sideWidgetParameters().iconSize : 16; const QSize iconSize(iconWidth, iconWidth); - const QPixmap iconPixmap = icon().pixmap(window, iconSize, state, QIcon::Off); + const QPixmap iconPixmap = icon().pixmap(iconSize, devicePixelRatio(), state, QIcon::Off); QRect pixmapRect = QRect(QPoint(0, 0), iconSize); pixmapRect.moveCenter(rect().center()); painter.setOpacity(m_opacity); |