From b9e5e5ea69682241f076ccea776cf14c77a9780d Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 17 Feb 2024 18:26:58 +0100 Subject: [PATCH] Windows style: remove unused function and member Remove the two unused functions devicePixelRatio() and appDevicePixelRatio() from QWindowsStylePrivate. Also remove an uneeded forward declaration and the member menuBarTimer. Change-Id: I18347744054fe9c904b0ee48e45788dc4d2a8233 Reviewed-by: Wladimir Leuschner Reviewed-by: Axel Spoerl Reviewed-by: Qt CI Bot --- src/widgets/styles/qwindowsstyle.cpp | 5 ----- src/widgets/styles/qwindowsstyle_p_p.h | 8 -------- 2 files changed, 13 deletions(-) diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index ae82f784ca..a62ca65428 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -88,11 +88,6 @@ enum QSliderDirection { SlUp, SlDown, SlLeft, SlRight }; QWindowsStylePrivate::QWindowsStylePrivate() = default; -qreal QWindowsStylePrivate::appDevicePixelRatio() -{ - return qApp->devicePixelRatio(); -} - // Returns \c true if the toplevel parent of \a widget has seen the Alt-key bool QWindowsStylePrivate::hasSeenAlt(const QWidget *widget) const { diff --git a/src/widgets/styles/qwindowsstyle_p_p.h b/src/widgets/styles/qwindowsstyle_p_p.h index 0c0350c3d2..dce60cbf8d 100644 --- a/src/widgets/styles/qwindowsstyle_p_p.h +++ b/src/widgets/styles/qwindowsstyle_p_p.h @@ -24,8 +24,6 @@ QT_BEGIN_NAMESPACE -class QTime; - class Q_WIDGETS_EXPORT QWindowsStylePrivate : public QCommonStylePrivate { Q_DECLARE_PUBLIC(QWindowsStyle) @@ -35,15 +33,12 @@ public: QWindowsStylePrivate(); static int pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *option = nullptr, const QWidget *widget = nullptr); static int fixedPixelMetric(QStyle::PixelMetric pm); - static qreal devicePixelRatio(const QWidget *widget = nullptr) - { return widget ? widget->devicePixelRatio() : QWindowsStylePrivate::appDevicePixelRatio(); } static qreal nativeMetricScaleFactor(const QWidget *widget = nullptr); bool hasSeenAlt(const QWidget *widget) const; bool altDown() const { return alt_down; } bool alt_down = false; QList seenAlt; - int menuBarTimer = 0; QColor inactiveCaptionText; QColor activeCaptionColor; @@ -60,9 +55,6 @@ public: windowsRightBorder = 15, // right border on windows windowsCheckMarkWidth = 12 // checkmarks width on windows }; - -private: - static qreal appDevicePixelRatio(); }; QT_END_NAMESPACE