Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qwindow_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 QWINDOW_P_H
5#define QWINDOW_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 <QtGui/private/qtguiglobal_p.h>
19#include <QtGui/qscreen.h>
20#include <QtGui/qwindow.h>
21#include <qpa/qplatformwindow.h>
22
23#include <QtCore/private/qobject_p.h>
24#include <QtCore/qelapsedtimer.h>
25#include <QtCore/qxpfunctional.h>
26#include <QtGui/qicon.h>
27#include <QtGui/qpalette.h>
28
30
31class Q_GUI_EXPORT QWindowPrivate : public QObjectPrivate
32{
33 Q_DECLARE_PUBLIC(QWindow)
34
35public:
37 {
39 WindowFrameExclusive
40 };
41
43 ~QWindowPrivate() override;
44
45 void init(QScreen *targetScreen = nullptr);
46
47#ifndef QT_NO_CURSOR
48 void setCursor(const QCursor *c = nullptr);
49 bool applyCursor();
50#endif
51
52 QPoint globalPosition() const;
53
54 QWindow *topLevelWindow(QWindow::AncestorMode mode = QWindow::IncludeTransients) const;
55
56 virtual QWindow *eventReceiver() { Q_Q(QWindow); return q; }
57 virtual QPalette windowPalette() const { return QPalette(); }
58
59 virtual void setVisible(bool visible);
60 void updateVisibility();
61 void _q_clearAlert();
62
63 enum SiblingPosition { PositionTop, PositionBottom };
64 void updateSiblingPosition(SiblingPosition);
65
66 bool windowRecreationRequired(QScreen *newScreen) const;
67 void create(bool recursive, WId nativeHandle = 0);
68 void destroy();
69 void setTopLevelScreen(QScreen *newScreen, bool recreate);
70 void connectToScreen(QScreen *topLevelScreen);
71 void disconnectFromScreen();
72 void emitScreenChangedRecursion(QScreen *newScreen);
73 QScreen *screenForGeometry(const QRect &rect) const;
74 void setTransientParent(QWindow *parent);
75
76 virtual void clearFocusObject();
77 virtual QRectF closestAcceptableGeometry(const QRectF &rect) const;
78
79 void setMinOrMaxSize(QSize *oldSizeMember, const QSize &size,
80 qxp::function_ref<void()> funcWidthChanged,
81 qxp::function_ref<void()> funcHeightChanged);
82
84
85 virtual bool participatesInLastWindowClosed() const;
86 virtual bool treatAsVisible() const;
87
88 bool isPopup() const { return (windowFlags & Qt::WindowType_Mask) == Qt::Popup; }
90 { positionAutomatic = resizeAutomatic = a; }
91
92 void updateDevicePixelRatio();
93
94 static QWindowPrivate *get(QWindow *window) { return window->d_func(); }
95
96 static Qt::WindowState effectiveState(Qt::WindowStates);
97
99 Qt::WindowFlags windowFlags = Qt::Window;
100 QWindow *parentWindow = nullptr;
101 QPlatformWindow *platformWindow = nullptr;
102 bool visible= false;
103 bool visibilityOnDestroy = false;
104 bool exposed = false;
105 bool inClose = false;
111 qreal devicePixelRatio = 1.0;
112 Qt::WindowStates windowState = Qt::WindowNoState;
113 QWindow::Visibility visibility = QWindow::Hidden;
114 bool resizeEventPending = true;
115 bool receivedExpose = false;
116 PositionPolicy positionPolicy = WindowFrameExclusive;
117 bool positionAutomatic = true;
118 // resizeAutomatic suppresses resizing by QPlatformWindow::initialGeometry().
119 // It also indicates that width/height=0 is acceptable (for example, for
120 // the QRollEffect widget) and is thus not cleared in setGeometry().
121 // An alternative approach might be using -1,-1 as a default size.
122 bool resizeAutomatic = true;
124 qreal opacity= 1;
126
127 QSize minimumSize = {0, 0};
131
133 bool blockedByModalWindow = false;
134
135 bool updateRequestPending = false;
136 bool transientParentPropertySet = false;
137
140
141#ifndef QT_NO_CURSOR
143 bool hasCursor = false;
144#endif
145
146 bool compositing = false;
148
149#if QT_CONFIG(vulkan)
150 QVulkanInstance *vulkanInstance = nullptr;
151#endif
152};
153
154
156
157#endif // QWINDOW_P_H
The QCursor class provides a mouse cursor with an arbitrary shape.
Definition qcursor.h:45
\inmodule QtCore
The QIcon class provides scalable icons in different modes and states.
Definition qicon.h:20
The QPalette class contains color groups for each widget state.
Definition qpalette.h:19
The QPlatformWindow class provides an abstraction for top-level windows.
\inmodule QtCore\reentrant
Definition qpoint.h:23
\inmodule QtCore
Definition qpointer.h:18
\inmodule QtCore\reentrant
Definition qrect.h:483
\inmodule QtCore\reentrant
Definition qrect.h:30
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
The QScreen class is used to query screen properties. \inmodule QtGui.
Definition qscreen.h:32
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
The QSurfaceFormat class represents the format of a QSurface. \inmodule QtGui.
SurfaceType
The SurfaceType enum describes what type of surface this is.
Definition qsurface.h:30
@ RasterSurface
Definition qsurface.h:31
The QVulkanInstance class represents a native Vulkan instance, enabling Vulkan rendering onto a QSurf...
QPointer< QScreen > topLevelScreen
Definition qwindow_p.h:139
static QWindowPrivate * get(QWindow *window)
Definition qwindow_p.h:94
QPointer< QWindow > transientParent
Definition qwindow_p.h:138
~QWindowPrivate() override
QString windowFilePath
Definition qwindow_p.h:108
QElapsedTimer lastComposeTime
Definition qwindow_p.h:147
void setAutomaticPositionAndResizeEnabled(bool a)
Definition qwindow_p.h:89
QSize sizeIncrement
Definition qwindow_p.h:130
virtual QWindow * eventReceiver()
Definition qwindow_p.h:56
virtual QPalette windowPalette() const
Definition qwindow_p.h:57
virtual void processSafeAreaMarginsChanged()
Definition qwindow_p.h:83
QSurfaceFormat requestedFormat
Definition qwindow_p.h:106
QString windowTitle
Definition qwindow_p.h:107
bool isPopup() const
Definition qwindow_p.h:88
\inmodule QtGui
Definition qwindow.h:63
QCursor cursor
rect
[4]
Combined button and popup list for selecting options.
WindowState
Definition qnamespace.h:250
@ WindowNoState
Definition qnamespace.h:251
WindowModality
@ NonModal
ScreenOrientation
Definition qnamespace.h:270
@ PrimaryOrientation
Definition qnamespace.h:271
@ ArrowCursor
@ Popup
Definition qnamespace.h:210
@ WindowType_Mask
Definition qnamespace.h:219
@ Window
Definition qnamespace.h:206
static void applyCursor(QWindow *w, QCursor c)
GLenum mode
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
const GLubyte * c
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
#define QWINDOWSIZE_MAX
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
double qreal
Definition qtypes.h:92
item setCursor(Qt::IBeamCursor)
[1]
aWidget window() -> setWindowTitle("New Window Title")
[2]
view create()
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent