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
4#ifndef QQUICKWINDOWSSTYLE_P_P_H
5#define QQUICKWINDOWSSTYLE_P_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of XX. This header
13// file may change from version to version without notice, or even be removed.
14//
15// We mean it.
16//
17
21
23
24namespace QQC2 {
25
29#include <qlist.h>
30
31class QTime;
32
35 Q_DECLARE_PUBLIC(QWindowsStyle)
36public:
37 enum { InvalidMetric = -23576 };
40 static int pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *option = nullptr);
41 static int fixedPixelMetric(QStyle::PixelMetric pm);
42 static qreal devicePixelRatio(const QStyleOption *option = nullptr)
43 {
44 return devicePixelRatio(option ? option->window : nullptr);
45 }
46
47 static qreal devicePixelRatio(const QWindow *win)
48 { return win ? win->devicePixelRatio() : QWindowsStylePrivate::appDevicePixelRatio(); }
49 static qreal nativeMetricScaleFactor(const QStyleOption *option = nullptr);
50 static qreal nativeMetricScaleFactor(const QWindow *win);
51 static bool isDarkMode();
53#if 0
54 bool hasSeenAlt(const QWidget *widget) const;
55 bool altDown() const { return alt_down; }
56 bool alt_down = false;
57#endif
59 int menuBarTimer = 0;
60
66
67 enum {
68 windowsItemFrame = 2, // menu item frame width
69 windowsSepHeight = 9, // separator item height
70 windowsItemHMargin = 3, // menu item hor text margin
71 windowsItemVMargin = 2, // menu item ver text margin
72 windowsArrowHMargin = 6, // arrow horizontal margin
73 windowsRightBorder = 15, // right border on windows
74 windowsCheckMarkWidth = 12 // checkmarks width on windows
75 };
76
77private:
78 static qreal appDevicePixelRatio();
79};
80
81} // namespace QQC2
82
83QT_END_NAMESPACE
84
85#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.
QWindowsStyle(QWindowsStylePrivate &dd)
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=nullptr) const override
\reimp
QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt) const override
\reimp
QRect subElementRect(SubElement r, const QStyleOption *opt) const override
\reimp
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p) const override
\reimp
int styleHint(StyleHint hint, const QStyleOption *opt=nullptr, QStyleHintReturn *returnData=nullptr) const override
\reimp
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize) const override
\reimp
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p) const override
\reimp
~QWindowsStyle() override
Destroys the QWindowsStyle object.
int pixelMetric(PixelMetric pm, const QStyleOption *option=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.
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p) const override
\reimp
static QScreen * screenOf(const QWindow *w)
Combined button and popup list for selecting options.