Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickwindowsstyle_p_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QQUICKWINDOWSSTYLE_P_P_H
6#define QQUICKWINDOWSSTYLE_P_P_H
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists for the convenience
13// of XX. This header
14// file may change from version to version without notice, or even be removed.
15//
16// We mean it.
17//
18
22
24
25namespace QQC2 {
26
30#include <qlist.h>
31
32class QTime;
33
36 Q_DECLARE_PUBLIC(QWindowsStyle)
37public:
38 enum { InvalidMetric = -23576 };
41 static int pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *option = nullptr);
42 static int fixedPixelMetric(QStyle::PixelMetric pm);
43 static qreal devicePixelRatio(const QStyleOption *option = nullptr)
44 {
45 return devicePixelRatio(option ? option->window : nullptr);
46 }
47
48 static qreal devicePixelRatio(const QWindow *win)
49 { return win ? win->devicePixelRatio() : QWindowsStylePrivate::appDevicePixelRatio(); }
50 static qreal nativeMetricScaleFactor(const QStyleOption *option = nullptr);
51 static qreal nativeMetricScaleFactor(const QWindow *win);
52 static bool isDarkMode();
53
54#if 0
55 bool hasSeenAlt(const QWidget *widget) const;
56 bool altDown() const { return alt_down; }
57 bool alt_down = false;
58#endif
60 int menuBarTimer = 0;
61
67
68 enum {
69 windowsItemFrame = 2, // menu item frame width
70 windowsSepHeight = 9, // separator item height
71 windowsItemHMargin = 3, // menu item hor text margin
72 windowsItemVMargin = 2, // menu item ver text margin
73 windowsArrowHMargin = 6, // arrow horizontal margin
74 windowsRightBorder = 15, // right border on windows
75 windowsCheckMarkWidth = 12 // checkmarks width on windows
76 };
78private:
79 static qreal appDevicePixelRatio();
80};
81
82} // namespace QQC2
83
84QT_END_NAMESPACE
85
86#endif //QQUICKWINDOWSSTYLE_P_P_H
static qreal devicePixelRatio(const QWindow *win)
static int fixedPixelMetric(QStyle::PixelMetric pm)
static qreal devicePixelRatio(const QStyleOption *option=nullptr)
static qreal nativeMetricScaleFactor(const QStyleOption *option=nullptr)
QList< const QWidget * > seenAlt
static int pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *option=nullptr)
static qreal nativeMetricScaleFactor(const QWindow *win)
The QWindowsStyle class provides a Microsoft Windows-like look and feel.
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=nullptr) const override
\reimp
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p) const override
\reimp
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p) const override
\reimp
QWindowsStyle(QWindowsStylePrivate &dd)
int pixelMetric(PixelMetric pm, const QStyleOption *option=nullptr) const override
\reimp
int styleHint(StyleHint hint, const QStyleOption *opt=nullptr, QStyleHintReturn *returnData=nullptr) const override
\reimp
void timerEvent(QTimerEvent *event) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt) const override
\reimp
~QWindowsStyle() override
Destroys the QWindowsStyle object.
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p) const override
\reimp
QRect subElementRect(SubElement r, const QStyleOption *opt) const override
\reimp
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize) const override
\reimp
static QScreen * screenOf(const QWindow *w)