summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qwindowsstyle_p_p.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-03-01 15:40:52 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-04-05 07:27:37 +0000
commit34a984c80739d034b6c0c9e0f29c73b03ddc5aa1 (patch)
treee52bf8be9a50124293e32040a8c079e2ffb07225 /src/widgets/styles/qwindowsstyle_p_p.h
parent670a9c00ef5ee4bbcbaaefa9482e39359180ac4f (diff)
Windows XP style: Change theme logic to use qreal.
Avoid rounding errors, thus preventing sizes becoming too small when High DPI scaling is in effect. Also fix division by zero crashes should a scale factor be below 1. Task-number: QTBUG-49374 Task-number: QTBUG-51552 Change-Id: I72718521bc3c7f6b0e42392ea2d2d3bbc61e2faa Reviewed-by: Marko Kangas <marko.kangas@theqtcompany.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
Diffstat (limited to 'src/widgets/styles/qwindowsstyle_p_p.h')
-rw-r--r--src/widgets/styles/qwindowsstyle_p_p.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/widgets/styles/qwindowsstyle_p_p.h b/src/widgets/styles/qwindowsstyle_p_p.h
index c8778cc914..7971b84923 100644
--- a/src/widgets/styles/qwindowsstyle_p_p.h
+++ b/src/widgets/styles/qwindowsstyle_p_p.h
@@ -64,8 +64,8 @@ public:
QWindowsStylePrivate();
static int pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *option = 0, const QWidget *widget = 0);
static int fixedPixelMetric(QStyle::PixelMetric pm);
- static int devicePixelRatio(const QWidget *widget = 0)
- { return widget ? int(widget->devicePixelRatioF()) : QWindowsStylePrivate::appDevicePixelRatio(); }
+ static qreal devicePixelRatio(const QWidget *widget = 0)
+ { return widget ? widget->devicePixelRatioF() : QWindowsStylePrivate::appDevicePixelRatio(); }
bool hasSeenAlt(const QWidget *widget) const;
bool altDown() const { return alt_down; }
@@ -90,8 +90,7 @@ public:
};
private:
- static int appDevicePixelRatio();
- static int m_appDevicePixelRatio;
+ static qreal appDevicePixelRatio();
};
QT_END_NAMESPACE