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
qtwindowsglobal.h
Go to the documentation of this file.
1// Copyright (C) 2013 Samuel Gaist <samuel.gaist@edeltech.ch>
2// Copyright (C) 2016 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4// Qt-Security score:significant reason:default
5
6#ifndef QTWINDOWSGLOBAL_H
7#define QTWINDOWSGLOBAL_H
8
9#include <QtCore/qt_windows.h>
10#include <QtCore/qnamespace.h>
11
12#ifndef WM_DWMCOMPOSITIONCHANGED
13# define WM_DWMCOMPOSITIONCHANGED 0x31E
14#endif
15
16#ifndef WM_DWMCOLORIZATIONCOLORCHANGED
17# define WM_DWMCOLORIZATIONCOLORCHANGED 0x0320
18#endif
19
20#ifndef WM_SYSCOLORCHANGE
21# define WM_SYSCOLORCHANGE 0x0015
22#endif
23
24#ifndef WM_TOUCH
25# define WM_TOUCH 0x0240
26#endif
27
28#ifndef WM_GESTURE
29# define WM_GESTURE 0x0119
30#endif
31
32#ifndef WM_DPICHANGED
33# define WM_DPICHANGED 0x02E0
34#endif
35
36#ifndef WM_GETDPISCALEDSIZE
37# define WM_GETDPISCALEDSIZE 0x02E4
38#endif
39
40// WM_POINTER support from Windows 8 onwards (WINVER >= 0x0602)
41#ifndef WM_POINTERUPDATE
42# define WM_NCPOINTERUPDATE 0x0241
43# define WM_NCPOINTERDOWN 0x0242
44# define WM_NCPOINTERUP 0x0243
45# define WM_POINTERUPDATE 0x0245
46# define WM_POINTERDOWN 0x0246
47# define WM_POINTERUP 0x0247
48# define WM_POINTERENTER 0x0249
49# define WM_POINTERLEAVE 0x024A
50# define WM_POINTERACTIVATE 0x024B
51# define WM_POINTERCAPTURECHANGED 0x024C
52# define WM_POINTERWHEEL 0x024E
53# define WM_POINTERHWHEEL 0x024F
54#endif // WM_POINTERUPDATE
55
56#if !defined(_DPI_AWARENESS_CONTEXTS_)
57# define DPI_AWARENESS_CONTEXT_UNAWARE ((HANDLE)-1)
58# define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((HANDLE)-2)
59# define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((HANDLE)-3)
60# define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((HANDLE)-4)
61# define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED ((HANDLE)-5)
62#endif
63
64QT_BEGIN_NAMESPACE
65
66namespace QtWindows
67{
68
69enum WindowsEventTypeFlags
70{
71 WindowEventFlag = 0x10000,
72 MouseEventFlag = 0x20000,
73 NonClientEventFlag = 0x40000,
74 InputMethodEventFlag = 0x80000,
75 KeyEventFlag = 0x100000,
76 KeyDownEventFlag = 0x200000,
77 TouchEventFlag = 0x400000,
78 ClipboardEventFlag = 0x800000,
79 ApplicationEventFlag = 0x1000000,
80 ThemingEventFlag = 0x2000000,
81 GenericEventFlag = 0x4000000, // Misc
82 PointerEventFlag = 0x8000000,
83};
84
85enum WindowsEventType // Simplify event types
86{
87 ExposeEvent = WindowEventFlag + 1,
88 ActivateWindowEvent = WindowEventFlag + 2,
89 DeactivateWindowEvent = WindowEventFlag + 3,
90 MouseActivateWindowEvent = WindowEventFlag + 4,
91 LeaveEvent = WindowEventFlag + 5,
92 CloseEvent = WindowEventFlag + 6,
93 ShowEvent = WindowEventFlag + 7,
94 ShowEventOnParentRestoring = WindowEventFlag + 20,
95 HideEvent = WindowEventFlag + 8,
96 DestroyEvent = WindowEventFlag + 9,
97 GeometryChangingEvent = WindowEventFlag + 10,
98 MoveEvent = WindowEventFlag + 11,
99 ResizeEvent = WindowEventFlag + 12,
100 QuerySizeHints = WindowEventFlag + 15,
101 CalculateSize = WindowEventFlag + 16,
102 FocusInEvent = WindowEventFlag + 17,
103 FocusOutEvent = WindowEventFlag + 18,
104 WhatsThisEvent = WindowEventFlag + 19,
105 DpiChangedEvent = WindowEventFlag + 21,
106 EnterSizeMoveEvent = WindowEventFlag + 22,
107 ExitSizeMoveEvent = WindowEventFlag + 23,
108 PointerActivateWindowEvent = WindowEventFlag + 24,
109 DpiScaledSizeEvent = WindowEventFlag + 25,
110 DpiChangedAfterParentEvent = WindowEventFlag + 27,
111 TaskbarButtonCreated = WindowEventFlag + 28,
112 MouseEvent = MouseEventFlag + 1,
113 MouseWheelEvent = MouseEventFlag + 2,
114 CursorEvent = MouseEventFlag + 3,
115 TouchEvent = TouchEventFlag + 1,
116 PointerEvent = PointerEventFlag + 1,
117 NonClientMouseEvent = NonClientEventFlag + MouseEventFlag + 1,
118 NonClientHitTest = NonClientEventFlag + 2,
119 NonClientCreate = NonClientEventFlag + 3,
120 NonClientActivate = NonClientEventFlag + 4,
121 NonClientPointerEvent = NonClientEventFlag + PointerEventFlag + 4,
122 KeyEvent = KeyEventFlag + 1,
123 KeyDownEvent = KeyEventFlag + KeyDownEventFlag + 1,
124 InputLanguageChangeEvent = KeyEventFlag + 2,
125 InputMethodKeyEvent = InputMethodEventFlag + KeyEventFlag + 1,
126 InputMethodKeyDownEvent = InputMethodEventFlag + KeyEventFlag + KeyDownEventFlag + 1,
127 ClipboardEvent = ClipboardEventFlag + 1,
128 ActivateApplicationEvent = ApplicationEventFlag + 1,
129 DeactivateApplicationEvent = ApplicationEventFlag + 2,
130 AccessibleObjectFromWindowRequest = ApplicationEventFlag + 3,
131 QueryEndSessionApplicationEvent = ApplicationEventFlag + 4,
132 EndSessionApplicationEvent = ApplicationEventFlag + 5,
133 AppCommandEvent = ApplicationEventFlag + 6,
134 DeviceChangeEvent = ApplicationEventFlag + 7,
135 MenuAboutToShowEvent = ApplicationEventFlag + 8,
136 AcceleratorCommandEvent = ApplicationEventFlag + 9,
137 MenuCommandEvent = ApplicationEventFlag + 10,
138 InputMethodStartCompositionEvent = InputMethodEventFlag + 1,
139 InputMethodCompositionEvent = InputMethodEventFlag + 2,
140 InputMethodEndCompositionEvent = InputMethodEventFlag + 3,
141 InputMethodOpenCandidateWindowEvent = InputMethodEventFlag + 4,
142 InputMethodCloseCandidateWindowEvent = InputMethodEventFlag + 5,
143 InputMethodRequest = InputMethodEventFlag + 6,
144 ThemeChanged = ThemingEventFlag + 1,
145 CompositionSettingsChanged = ThemingEventFlag + 2,
146 SettingChangedEvent = 438,
147 ScrollEvent = GenericEventFlag + 1,
148 ContextMenu = 123,
149 GestureEvent = 124,
150 UnknownEvent = 542
151};
152Q_DECLARE_MIXED_ENUM_OPERATORS(bool, WindowsEventTypeFlags, WindowsEventType);
153Q_DECLARE_MIXED_ENUM_OPERATORS(bool, WindowsEventType, WindowsEventTypeFlags);
154
155enum class DpiAwareness
156{
157 Invalid = -1,
158 Unaware,
159 System,
160 PerMonitor,
161 PerMonitorVersion2,
162 Unaware_GdiScaled
163};
164
165} // namespace QtWindows
166
167inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamIn, LPARAM lParamIn)
168{
169 static const UINT WM_TASKBAR_BUTTON_CREATED = []{
170 UINT message = RegisterWindowMessage(L"TaskbarButtonCreated");
171 // In case the application is run elevated, allow the
172 // TaskbarButtonCreated message through.
173 ChangeWindowMessageFilter(message, MSGFLT_ADD);
174 return message;
175 }();
176
177 switch (message) {
178 case WM_PAINT:
179 case WM_ERASEBKGND:
180 return QtWindows::ExposeEvent;
181 case WM_CLOSE:
182 return QtWindows::CloseEvent;
183 case WM_DESTROY:
184 return QtWindows::DestroyEvent;
185 case WM_ACTIVATEAPP:
186 return (int)wParamIn ?
187 QtWindows::ActivateApplicationEvent : QtWindows::DeactivateApplicationEvent;
188 case WM_MOUSEACTIVATE:
189 return QtWindows::MouseActivateWindowEvent;
191 return QtWindows::PointerActivateWindowEvent;
192 case WM_ACTIVATE:
193 return LOWORD(wParamIn) == WA_INACTIVE ?
194 QtWindows::DeactivateWindowEvent : QtWindows::ActivateWindowEvent;
195 case WM_SETCURSOR:
196 return QtWindows::CursorEvent;
197 case WM_MOUSELEAVE:
198 return QtWindows::MouseEvent;
199 case WM_HSCROLL:
200 return QtWindows::ScrollEvent;
201 case WM_MOUSEWHEEL:
202 case WM_MOUSEHWHEEL:
203 return QtWindows::MouseWheelEvent;
204 case WM_WINDOWPOSCHANGING:
205 return QtWindows::GeometryChangingEvent;
206 case WM_MOVE:
207 return QtWindows::MoveEvent;
208 case WM_SHOWWINDOW:
209 if (wParamIn)
210 return lParamIn == SW_PARENTOPENING ? QtWindows::ShowEventOnParentRestoring : QtWindows::ShowEvent;
211 return QtWindows::HideEvent;
212 case WM_SIZE:
213 return QtWindows::ResizeEvent;
214 case WM_NCCREATE:
215 return QtWindows::NonClientCreate;
216 case WM_NCCALCSIZE:
217 return QtWindows::CalculateSize;
218 case WM_NCHITTEST:
219 return QtWindows::NonClientHitTest;
220 case WM_NCACTIVATE:
221 return QtWindows::NonClientActivate;
222 case WM_GETMINMAXINFO:
223 return QtWindows::QuerySizeHints;
224 case WM_KEYDOWN: // keyboard event
225 case WM_SYSKEYDOWN:
226 return QtWindows::KeyDownEvent;
227 case WM_KEYUP:
228 case WM_SYSKEYUP:
229 case WM_CHAR:
230 return QtWindows::KeyEvent;
231 case WM_IME_CHAR:
232 return QtWindows::InputMethodKeyEvent;
233 case WM_IME_KEYDOWN:
234 return QtWindows::InputMethodKeyDownEvent;
235#ifdef WM_INPUTLANGCHANGE
236 case WM_INPUTLANGCHANGE:
237 return QtWindows::InputLanguageChangeEvent;
238#endif // WM_INPUTLANGCHANGE
239 case WM_TOUCH:
240 return QtWindows::TouchEvent;
241 case WM_CHANGECBCHAIN:
242 case WM_DRAWCLIPBOARD:
243 case WM_RENDERFORMAT:
244 case WM_RENDERALLFORMATS:
245 case WM_DESTROYCLIPBOARD:
246 return QtWindows::ClipboardEvent;
247 case WM_IME_STARTCOMPOSITION:
248 return QtWindows::InputMethodStartCompositionEvent;
249 case WM_IME_ENDCOMPOSITION:
250 return QtWindows::InputMethodEndCompositionEvent;
251 case WM_IME_COMPOSITION:
252 return QtWindows::InputMethodCompositionEvent;
253 case WM_IME_REQUEST:
254 return QtWindows::InputMethodRequest;
255 case WM_IME_NOTIFY:
256 switch (int(wParamIn)) {
257 case IMN_OPENCANDIDATE:
258 return QtWindows::InputMethodOpenCandidateWindowEvent;
259 case IMN_CLOSECANDIDATE:
260 return QtWindows::InputMethodCloseCandidateWindowEvent;
261 default:
262 break;
263 }
264 break;
265 case WM_GETOBJECT:
266 return QtWindows::AccessibleObjectFromWindowRequest;
267 case WM_SETFOCUS:
268 return QtWindows::FocusInEvent;
269 case WM_KILLFOCUS:
270 return QtWindows::FocusOutEvent;
271 // Among other things, WM_SETTINGCHANGE happens when the taskbar is moved
272 // and therefore the "working area" changes.
273 // http://msdn.microsoft.com/en-us/library/ms695534(v=vs.85).aspx
274 case WM_SETTINGCHANGE:
275 return QtWindows::SettingChangedEvent;
276 case WM_THEMECHANGED:
277 case WM_SYSCOLORCHANGE: // Handle color change as theme change (QTBUG-34170).
279 return QtWindows::ThemeChanged;
281 return QtWindows::CompositionSettingsChanged;
282#ifndef QT_NO_CONTEXTMENU
283 case WM_CONTEXTMENU:
284 return QtWindows::ContextMenu;
285#endif
286 case WM_SYSCOMMAND:
287 if ((wParamIn & 0xfff0) == SC_CONTEXTHELP)
288 return QtWindows::WhatsThisEvent;
289 break;
290 case WM_QUERYENDSESSION:
291 return QtWindows::QueryEndSessionApplicationEvent;
292 case WM_ENDSESSION:
293 return QtWindows::EndSessionApplicationEvent;
294#if defined(WM_APPCOMMAND)
295 case WM_APPCOMMAND:
296 return QtWindows::AppCommandEvent;
297#endif
298 case WM_GESTURE:
299 return QtWindows::GestureEvent;
300 case WM_DEVICECHANGE:
301 return QtWindows::DeviceChangeEvent;
302 case WM_INITMENU:
303 case WM_INITMENUPOPUP:
304 return QtWindows::MenuAboutToShowEvent;
305 case WM_COMMAND:
306 return HIWORD(wParamIn) ? QtWindows::AcceleratorCommandEvent : QtWindows::MenuCommandEvent;
307 case WM_DPICHANGED:
308 return QtWindows::DpiChangedEvent;
309 case WM_DPICHANGED_AFTERPARENT:
310 return QtWindows::DpiChangedAfterParentEvent;
312 return QtWindows::DpiScaledSizeEvent;
313 case WM_ENTERSIZEMOVE:
314 return QtWindows::EnterSizeMoveEvent;
315 case WM_EXITSIZEMOVE:
316 return QtWindows::ExitSizeMoveEvent;
317 default:
318 break;
319 }
320 if (message >= WM_NCMOUSEMOVE && message <= WM_NCMBUTTONDBLCLK)
321 return QtWindows::NonClientMouseEvent; //
322 if ((message >= WM_MOUSEFIRST && message <= WM_MOUSELAST)
323 || (message >= WM_XBUTTONDOWN && message <= WM_XBUTTONDBLCLK))
324 return QtWindows::MouseEvent;
325 if (message >= WM_NCPOINTERUPDATE && message <= WM_NCPOINTERUP)
326 return QtWindows::NonClientPointerEvent;
327 if (message >= WM_POINTERUPDATE && message <= WM_POINTERHWHEEL)
328 return QtWindows::PointerEvent;
329 if (message == WM_TASKBAR_BUTTON_CREATED)
330 return QtWindows::TaskbarButtonCreated;
331 return QtWindows::UnknownEvent;
332}
333
334#ifndef QT_NO_DEBUG_STREAM
335extern QDebug operator<<(QDebug, QtWindows::DpiAwareness);
336#endif
337
339
340#endif // QTWINDOWSGLOBAL_H
Base class for QWindowsForeignWindow, QWindowsWindow.
virtual bool isTopLevel() const
QMargins frameMargins_sys() const
bool isTopLevel_sys() const
unsigned exStyle() const
void setHasBorderInFullScreen(bool border) override
QMargins customMargins() const override
bool windowEvent(QEvent *event) override
Reimplement this method to be able to do any platform specific event handling.
bool hasBorderInFullScreen() const override
static QWindowsBaseWindow * baseWindowOf(const QWindow *w)
bool hasMaximumWidth() const
HWND parentHwnd() const
virtual QMargins fullFrameMargins() const
unsigned style() const
QRect geometry() const override
Returns the current geometry of a window.
std::optional< TouchWindowTouchTypes > touchWindowTouchTypes_sys() const
static HWND handleOf(const QWindow *w)
QPoint mapToGlobal(const QPoint &pos) const override
Translates the window coordinate pos to global screen coordinates using native methods.
QMargins frameMargins() const override
QWindowsBaseWindow(QWindow *window)
bool hasMaximumHeight() const
static bool isRtlLayout(HWND hwnd)
QRect frameGeometry_sys() const
WId winId() const override
Reimplement in subclasses to return a handle to the native window.
QRect geometry_sys() const
virtual HWND handle() const =0
QPoint mapFromGlobal(const QPoint &pos) const override
Translates the global screen coordinate pos to window coordinates using native methods.
void setCustomMargins(const QMargins &margins) override
void setGeometry_sys(const QRect &rect) const
bool hasMaximumSize() const
void setWindowTitle_sys(const QString &title)
Platform cursor implementation.
static bool hasOverrideCursor()
static QPoint mousePosition()
void setOverrideCursor(const QCursor &cursor) override
Reimplement this function in subclass to set an override cursor on the associated screen and return t...
static HCURSOR createPixmapCursor(const PixmapCursor &pc, qreal scaleFactor=1)
static HCURSOR createPixmapCursor(QPixmap pixmap, const QPoint &hotSpot, qreal scaleFactor=1)
void changeCursor(QCursor *widgetCursor, QWindow *widget) override
Set a cursor on a window.
static PixmapCursor customCursor(Qt::CursorShape cursorShape, const QPlatformScreen *screen=nullptr)
HCURSOR hCursor(const QCursor &c) const
void clearOverrideCursor() override
Reimplement this function in subclass to clear the override cursor.
CursorHandlePtr standardWindowCursor(Qt::CursorShape s=Qt::ArrowCursor)
Return cached standard cursor resources or create new ones.
static State cursorState()
static HCURSOR createCursorFromShape(Qt::CursorShape cursorShape, const QPlatformScreen *screen=nullptr)
static void enforceOverrideCursor()
QWindowsCursor(const QPlatformScreen *screen)
QPixmap dragDefaultCursor(Qt::DropAction action) const
CursorHandlePtr pixmapWindowCursor(const QCursor &c)
Return cached pixmap cursor or create new one.
QSize size() const override
Returns the size of the cursor, in native pixels.
QPoint pos() const override
void setPos(const QPoint &pos) override
Window wrapping GetDesktopWindow not allowing any manipulation.
HWND handle() const override
QMargins frameMargins() const override
QWindowsDesktopWindow(QWindow *window)
bool isTopLevel() const override
Window wrapping a foreign native window.
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
bool isForeignWindow() const override
HWND handle() const override
void lower() override
Reimplement to be able to let Qt lower windows to the bottom of the desktop.
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
void setParent(const QPlatformWindow *window) override
This function is called to enable native child window in QPA.
void setWindowTitle(const QString &title) override
Reimplement to set the window title to title.
QWindowsForeignWindow(QWindow *window, HWND hwnd)
void raise() override
Reimplement to be able to let Qt raise windows to the top of the desktop.
static QWindowsStaticOpenGLContext * staticOpenGLContext()
Windows native menu bar.
Provides access to native handles.
void * nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) override
void * nativeResourceForWindow(const QByteArray &resource, QWindow *window) override
void * nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override
void * nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override
Implementation of IDropTarget.
Manages a list of QWindowsScreen.
bool handleScreenChanges()
Synchronizes the screen list, adds new screens, removes deleted ones and propagates resolution change...
const QWindowsScreen * screenForHwnd(HWND hwnd) const
const WindowsScreenList & screens() const
const QWindowsScreen * screenForRect(const RECT *rect) const
Windows screen.
qreal refreshRate() const override
Reimplement this function in subclass to return the vertical refresh rate of the screen,...
QString serialNumber() const override
Reimplement this function in subclass to return the serial number of this screen.
QDpi logicalDpi() const override
Reimplement this function in subclass to return the logical horizontal and vertical dots per inch met...
QList< QPlatformScreen * > virtualSiblings() const override
Determine siblings in a virtual desktop system.
Qt::ScreenOrientation orientation() const override
Reimplement this function in subclass to return the current orientation of the screen,...
QPlatformCursor * cursor() const override
Reimplement this function in subclass to return the cursor of the screen.
QPixmap grabWindow(WId window, int qX, int qY, int qWidth, int qHeight) const override
This function is called when Qt needs to be able to grab the content of a window.
QRect geometry() const override
Reimplement in subclass to return the pixel geometry of the screen.
qreal devicePixelRatio() const override
Reimplement this function in subclass to return the device pixel ratio for the screen.
const CursorPtr & cursorPtr() const
QPlatformScreen::SubpixelAntialiasingType subpixelAntialiasingTypeHint() const override
Queries ClearType settings to check the pixel layout.
static bool setOrientationPreference(Qt::ScreenOrientation o)
static int baseDpi
QRect availableGeometry() const override
Reimplement in subclass to return the pixel geometry of the available space This normally is the desk...
QString name() const override
QString manufacturer() const override
Reimplement this function in subclass to return the manufacturer of this screen.
QString model() const override
Reimplement this function in subclass to return the model of this screen.
QDpi logicalBaseDpi() const override
Reimplement to return the base logical DPI for the platform.
HMONITOR handle() const override
int depth() const override
Reimplement in subclass to return current depth of the screen.
QSizeF physicalSize() const override
Reimplement this function in subclass to return the physical size of the screen, in millimeters.
const QWindowsScreenData & data() const
QImage::Format format() const override
Reimplement in subclass to return the image format which corresponds to the screen format.
static Qt::ScreenOrientation orientationPreference()
virtual void * moduleHandle() const =0
Raster or OpenGL Window.
bool handleNonClientHitTest(const QPoint &globalPos, LRESULT *result) const
void alertWindow(int durationMs=0)
void setWindowFlags(Qt::WindowFlags flags) override
Requests setting the window flags of this surface to flags.
void setCustomMargins(const QMargins &m) override
Sets custom margins to be added to the default margins determined by the windows style in the handlin...
void setMenuBar(QWindowsMenuBar *mb)
static QWindowsWindow * windowsWindowOf(const QWindow *w)
void invalidateSurface() override
Invalidates the window's surface by releasing its surface buffers.
HDC getDC()
Allocates a HDC for the window or returns the temporary one obtained from WinAPI BeginPaint within a ...
QMargins fullFrameMargins() const override
void checkForScreenChanged(ScreenChangeMode mode=FromGeometryChange, const RECT *suggestedRect=nullptr)
void initialize() override
Called as part of QWindow::create(), after constructing the window.
void handleDpiChangedAfterParent(HWND hwnd)
static void setHasBorderInFullScreenStatic(QWindow *window, bool border)
int savedDpi() const
void requestUpdate() override
Requests an QEvent::UpdateRequest event.
bool testFlag(unsigned f) const
static QString formatWindowTitle(const QString &title)
void setFlag(unsigned f) const
void clearFlag(unsigned f) const
void setFrameStrutEventsEnabled(bool enabled) override
Reimplement this method to set whether frame strut events should be sent to enabled.
static void settingsChanged()
static bool handleGeometryChangingMessage(MSG *message, const QWindow *qWindow, const QMargins &marginsDp)
void getSizeHints(MINMAXINFO *mmi) const
static void setHasBorderInFullScreenDefault(bool border)
~QWindowsWindow() override
bool handleWmPaint(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result)
void setParent(const QPlatformWindow *window) override
This function is called to enable native child window in QPA.
static bool hasNoNativeFrame(HWND hwnd, Qt::WindowFlags flags)
qreal opacity() const
QRect restoreGeometry() const
static void * userDataOf(HWND hwnd)
bool setMouseGrabEnabled(bool grab) override
void propagateSizeHints() override
Reimplement to propagate the size hints of the QWindow.
static void setUserDataOf(HWND hwnd, void *ud)
void applyCursor()
Applies to cursor property set on the window to the global cursor.
bool isExposed() const override
Returns if this window is exposed in the windowing system.
bool handleGeometryChanging(MSG *message) const
bool isActive() const override
Returns true if the window should appear active from a style perspective.
void setStyle(unsigned s) const
static QScreen * forcedScreenForGLWindow(const QWindow *w)
QString windowTitle() const override
Reimplement to return the actual window title used in the underlying windowing system unless the titl...
static void displayChanged()
bool setKeyboardGrabEnabled(bool grab) override
static bool setWindowLayered(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, qreal opacity)
void raise() override
Reimplement to be able to let Qt raise windows to the top of the desktop.
bool windowEvent(QEvent *event) override
Reimplement this method to be able to do any platform specific event handling.
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
void setEnabled(bool enabled)
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
QSurfaceFormat format() const override
Returns the actual surface format of the window.
static const char * embeddedNativeParentHandleProperty
QWindowsMenuBar * menuBar() const
bool isLayered() const
void handleDpiChanged(HWND hwnd, WPARAM wParam, LPARAM lParam)
QMargins frameMargins() const override
void setWindowIcon(const QIcon &icon) override
Reimplement to set the window icon to icon.
bool isClientAreaExpanded() const
void handleResized(int wParam, LPARAM lParam)
void setOpacity(qreal level) override
Reimplement to be able to let Qt set the opacity level of a window.
bool isEmbedded() const override
Returns true if the window is a child of a non-Qt window.
QMargins customMargins() const override
bool handleNonClientActivate(LRESULT *result) const
bool isEnabled() const
bool isAncestorOf(const QPlatformWindow *child) const override
Returns true if the window is an ancestor of the given child.
QRect normalGeometry() const override
Returns the geometry of a window in 'normal' state (neither maximized, fullscreen nor minimized) for ...
void setExStyle(unsigned s) const
qreal dpiRelativeScale(const UINT dpi) const
QMargins safeAreaMargins() const override
The safe area margins of a window represent the area that is safe to place content within,...
void setSavedDpi(int dpi)
void requestActivateWindow() override
Reimplement to let Qt be able to request activation/focus for a window.
static QWindow * topLevelOf(QWindow *w)
void handleDpiScaledSize(WPARAM wParam, LPARAM lParam, LRESULT *result)
static bool setDarkBorderToWindow(HWND hwnd, bool d)
QRect geometry() const override
Returns the current geometry of a window.
bool frameStrutEventsEnabled() const override
Reimplement this method to return whether frame strut events are enabled.
@ WithinSetParent
Automatic mouse capture on button press.
QPoint mapToGlobal(const QPoint &pos) const override
Translates the window coordinate pos to global screen coordinates using native methods.
static const char * hasBorderInFullScreenProperty
bool startSystemMove() override
Reimplement this method to start a system move operation if the system supports it and return true to...
bool isTopLevel() const override
void releaseDC()
Releases the HDC for the window or does nothing in case it was obtained from WinAPI BeginPaint within...
void lower() override
Reimplement to be able to let Qt lower windows to the bottom of the desktop.
void setWindowState(Qt::WindowStates state) override
Requests setting the window state of this surface to type.
void setCursor(const CursorHandlePtr &c)
bool hasBorderInFullScreen() const override
bool hasMouseCapture() const
void * surface(void *nativeConfig, int *err)
void setHasBorderInFullScreen(bool border) override
QPoint mapFromGlobal(const QPoint &pos) const override
Translates the global screen coordinate pos to window coordinates using native methods.
CursorHandlePtr cursor() const
bool isVisible() const
void handleCompositionSettingsChanged()
void setWindowTitle(const QString &title) override
Reimplement to set the window title to title.
void setDarkBorder(bool d)
QWindowsWindow(QWindow *window, const QWindowsWindowData &data)
bool startSystemResize(Qt::Edges edges) override
Reimplement this method to start a system resize operation if the system supports it and return true ...
void setFullFrameMargins(const QMargins &newMargins)
void setMask(const QRegion &region) override
Reimplement to be able to let Qt set the mask of a window.
void setAlertState(bool enabled) override
Reimplement this method to set whether the window demands attention (for example, by flashing the tas...
HWND handle() const override
bool isAlertState() const override
Reimplement this method return whether the window is in an alert state.
Combined button and popup list for selecting options.
static int resourceType(const QByteArray &key)
#define WM_GESTURE
#define WM_TOUCH
#define WM_POINTERUPDATE
#define WM_GETDPISCALEDSIZE
#define WM_NCPOINTERUP
#define WM_POINTERHWHEEL
#define WM_DPICHANGED
#define WM_SYSCOLORCHANGE
#define WM_DWMCOMPOSITIONCHANGED
#define WM_NCPOINTERUPDATE
#define WM_POINTERACTIVATE
#define WM_DWMCOLORIZATIONCOLORCHANGED
bool operator==(const QWindowsPixmapCursorCacheKey &k1, const QWindowsPixmapCursorCacheKey &k2)
size_t qHash(const QWindowsPixmapCursorCacheKey &k, size_t seed) noexcept
static void clientToScreen(HWND hwnd, POINT *wP)
static void screenToClient(HWND hwnd, POINT *wP)
Active Context for creating windows.
const QScreen * screen
const QWindow * window
QWindowCreationContext(const QWindow *w, const QScreen *s, const QRect &geometryIn, const QRect &geometry, const QMargins &customMargins, DWORD style, DWORD exStyle)
void applyToMinMaxInfo(MINMAXINFO *mmi) const
PixmapCursor(const QPixmap &pix=QPixmap(), const QPoint &h=QPoint())
Stores geometry constraints and provides utility functions.
static QMargins frameOnPrimaryScreen(const QWindow *w, DWORD style, DWORD exStyle)
static QMargins frame(const QWindow *w, HWND hwnd)
static QMargins frame(const QWindow *w, const QRect &geometry, DWORD style, DWORD exStyle)
static QMargins frameOnPrimaryScreen(const QWindow *w, HWND hwnd)
static bool positionIncludesFrame(const QWindow *w)
static bool handleCalculateSize(const QWindow *window, const QMargins &customMargins, const MSG &msg, LRESULT *result)
static QPoint mapToGlobal(const QWindow *w, const QPoint &)
static QMargins frame(const QWindow *w, DWORD style, DWORD exStyle, qreal dpi)
static QPoint mapToGlobal(HWND hwnd, const QPoint &)
static QPoint mapFromGlobal(const HWND hwnd, const QPoint &)
static QPoint mapFromGlobal(const QWindow *w, const QPoint &)
static void applyToMinMaxInfo(const QWindow *w, const QMargins &margins, MINMAXINFO *mmi)
static void applyToMinMaxInfo(const QWindow *w, const QScreen *screen, const QMargins &margins, MINMAXINFO *mmi)
QWindowsPixmapCursorCacheKey(const QCursor &c, qreal scaleFactor)
Qt::WindowFlags flags
static QWindowsWindowData create(const QWindow *w, const QWindowsWindowData &parameters, const QString &title)