QWizard: Support fractional DPR on Windows
We were storing the DPR as int; change to qreal. Task-number: QTBUG-114175 Pick-to: 6.2 6.5 6.6 Change-Id: I7dc7df82f584cddbbb3f690f1df74e7a30369ab2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
530d092eae
commit
c0e48ed645
@ -33,7 +33,7 @@ Q_DECLARE_METATYPE(QMargins)
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
int QVistaHelper::m_devicePixelRatio = 1;
|
qreal QVistaHelper::m_devicePixelRatio = 1.0;
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
** QVistaBackButton
|
** QVistaBackButton
|
||||||
@ -82,7 +82,7 @@ void QVistaBackButton::paintEvent(QPaintEvent *)
|
|||||||
RECT clipRect;
|
RECT clipRect;
|
||||||
int xoffset = origin.x() + QWidget::mapToParent(r.topLeft()).x() - 1;
|
int xoffset = origin.x() + QWidget::mapToParent(r.topLeft()).x() - 1;
|
||||||
int yoffset = origin.y() + QWidget::mapToParent(r.topLeft()).y() - 1;
|
int yoffset = origin.y() + QWidget::mapToParent(r.topLeft()).y() - 1;
|
||||||
const int dpr = devicePixelRatio();
|
const qreal dpr = devicePixelRatio();
|
||||||
const QRect rDp = QRect(r.topLeft() * dpr, r.size() * dpr);
|
const QRect rDp = QRect(r.topLeft() * dpr, r.size() * dpr);
|
||||||
const int xoffsetDp = xoffset * dpr;
|
const int xoffsetDp = xoffset * dpr;
|
||||||
const int yoffsetDp = yoffset * dpr;
|
const int yoffsetDp = yoffset * dpr;
|
||||||
|
@ -110,7 +110,7 @@ private:
|
|||||||
|
|
||||||
int titleBarOffset; // Extra spacing above the text
|
int titleBarOffset; // Extra spacing above the text
|
||||||
int iconSpacing; // Space between button and icon
|
int iconSpacing; // Space between button and icon
|
||||||
static int m_devicePixelRatio;
|
static qreal m_devicePixelRatio;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user