Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwizard_win_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 QWIZARD_WIN_P_H
5#define QWIZARD_WIN_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 purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtWidgets/private/qtwidgetsglobal_p.h>
19
20#if QT_CONFIG(style_windowsvista)
21
22#include <qobject.h>
23#include <qwidget.h>
24#include <qabstractbutton.h>
25#include <QtWidgets/private/qwidget_p.h>
26#include <QtWidgets/private/qstylehelper_p.h>
27#include <qt_windows.h>
28
29QT_REQUIRE_CONFIG(wizard);
30
32
33class QVistaBackButton : public QAbstractButton
34{
35public:
36 QVistaBackButton(QWidget *widget);
37
38 QSize sizeHint() const override;
39 inline QSize minimumSizeHint() const override
40 { return sizeHint(); }
41
42 void enterEvent(QEnterEvent *event) override;
43 void leaveEvent(QEvent *event) override;
44 void paintEvent(QPaintEvent *event) override;
45};
46
47class QWizard;
48
49class QVistaHelper : public QObject
50{
51 Q_DISABLE_COPY_MOVE(QVistaHelper)
52public:
53 QVistaHelper(QWizard *wizard);
54 ~QVistaHelper() override;
55 enum TitleBarChangeType { NormalTitleBar, ExtendedTitleBar };
56 void updateCustomMargins(bool vistaMargins);
57 bool setDWMTitleBar(TitleBarChangeType type);
58 void setTitleBarIconAndCaptionVisible(bool visible);
59 void mouseEvent(QEvent *event);
60 bool handleWinEvent(MSG *message, qintptr *result);
61 void resizeEvent(QResizeEvent *event);
62 void paintEvent(QPaintEvent *event);
63 QVistaBackButton *backButton() const { return backButton_; }
64 void disconnectBackButton();
65 void hideBackButton() { if (backButton_) backButton_->hide(); }
66 QColor basicWindowFrameColor();
67 static int titleBarSize() { return QVistaHelper::titleBarSizeDp() / QVistaHelper::m_devicePixelRatio; }
68 static int titleBarSizeDp() { return QVistaHelper::frameSizeDp() + QVistaHelper::captionSizeDp(); }
69 static int topPadding(const QPaintDevice *device) { // padding under text
70 return int(QStyleHelper::dpiScaled(4, device));
71 }
72 static int topOffset(const QPaintDevice *device);
73
74 static HDC backingStoreDC(const QWidget *wizard, QPoint *offset);
75
76private:
77 HWND wizardHWND() const;
78 void drawTitleText(QPainter *painter, const QString &text, const QRect &rect, HDC hdc);
79 static void drawBlackRect(const QRect &rect, HDC hdc);
80
81 static int frameSize() { return QVistaHelper::frameSizeDp() / QVistaHelper::m_devicePixelRatio; }
82 static int frameSizeDp();
83 static int captionSize() { return QVistaHelper::captionSizeDp() / QVistaHelper::m_devicePixelRatio; }
84 static int captionSizeDp();
85
86 static int backButtonSize(const QPaintDevice *device)
87 { return int(QStyleHelper::dpiScaled(30, device)); }
88 static int iconSize(const QPaintDevice *device);
89 static int glowSize(const QPaintDevice *device);
90 int leftMargin(const QPaintDevice *device)
91 { return backButton_->isVisible() ? backButtonSize(device) + iconSpacing : 0; }
92
93 int titleOffset();
94 void drawTitleBar(QPainter *painter);
95 void setMouseCursor(QPoint pos);
96 void collapseTopFrameStrut();
97 bool winEvent(MSG *message, qintptr *result);
98 void mouseMoveEvent(QMouseEvent *event);
99 void mousePressEvent(QMouseEvent *event);
100 void mouseReleaseEvent(QMouseEvent *event);
101 bool eventFilter(QObject *obj, QEvent *event) override;
102
103 enum Changes { resizeTop, movePosition, noChange } change;
104 QPoint pressedPos;
105 bool pressed;
106 QRect rtTop;
107 QRect rtTitle;
108 QWizard *wizard;
109 QVistaBackButton *backButton_;
110
111 int titleBarOffset; // Extra spacing above the text
112 int iconSpacing; // Space between button and icon
113 static qreal m_devicePixelRatio;
114};
115
116
118
119#endif // style_windowsvista
120#endif // QWIZARD_WIN_P_H
IOBluetoothDevice * device
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\inmodule QtGui
Definition qevent.h:165
\inmodule QtCore
Definition qcoreevent.h:45
\inmodule QtGui
Definition qevent.h:196
\inmodule QtCore
Definition qobject.h:103
The QPaintEvent class contains event parameters for paint events.
Definition qevent.h:486
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore\reentrant
Definition qrect.h:30
The QResizeEvent class contains event parameters for resize events.
Definition qevent.h:548
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
The QWizard class provides a framework for wizards.
Definition qwizard.h:19
QOpenGLWidget * widget
[1]
QString text
opt iconSize
rect
[4]
Q_WIDGETS_EXPORT qreal dpiScaled(qreal value, qreal dpi)
Combined button and popup list for selecting options.
GLenum type
GLuint GLsizei const GLchar * message
GLenum GLuint GLintptr offset
struct _cl_event * event
GLhandleARB obj
[2]
GLuint64EXT * result
[6]
static constexpr QSize frameSize(const T &frame)
#define QT_REQUIRE_CONFIG(feature)
double qreal
Definition qtypes.h:187
ptrdiff_t qintptr
Definition qtypes.h:166
struct tagMSG MSG
QPainter painter(this)
[7]