Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qwindowswindow.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 QWINDOWSWINDOW_H
5#define QWINDOWSWINDOW_H
6
7#include <QtCore/qt_windows.h>
8#include <QtCore/qpointer.h>
10#include "qwindowscursor.h"
11
12#include <qpa/qplatformwindow.h>
13#include <qpa/qplatformwindow_p.h>
14
15#if QT_CONFIG(vulkan)
17#endif
18
19#include <optional>
20
22
24class QWindowsMenuBar;
25class QDebug;
26
28{
29 static QMargins frameOnPrimaryScreen(const QWindow *w, DWORD style, DWORD exStyle);
30 static QMargins frameOnPrimaryScreen(const QWindow *w, HWND hwnd);
31 static QMargins frame(const QWindow *w, DWORD style, DWORD exStyle, qreal dpi);
32 static QMargins frame(const QWindow *w, HWND hwnd, DWORD style, DWORD exStyle);
33 static QMargins frame(const QWindow *w, HWND hwnd);
34 static QMargins frame(const QWindow *w, const QRect &geometry,
35 DWORD style, DWORD exStyle);
36 static bool handleCalculateSize(const QMargins &customMargins, const MSG &msg, LRESULT *result);
37 static void applyToMinMaxInfo(const QWindow *w, const QScreen *screen,
38 const QMargins &margins, MINMAXINFO *mmi);
39 static void applyToMinMaxInfo(const QWindow *w, const QMargins &margins,
40 MINMAXINFO *mmi);
41 static void frameSizeConstraints(const QWindow *w, const QScreen *screen,
42 const QMargins &margins,
43 QSize *minimumSize, QSize *maximumSize);
44 static inline QPoint mapToGlobal(HWND hwnd, const QPoint &);
45 static inline QPoint mapToGlobal(const QWindow *w, const QPoint &);
46 static inline QPoint mapFromGlobal(const HWND hwnd, const QPoint &);
47 static inline QPoint mapFromGlobal(const QWindow *w, const QPoint &);
48
49 static bool positionIncludesFrame(const QWindow *w);
50};
51
53{
54 explicit QWindowCreationContext(const QWindow *w, const QScreen *s,
55 const QRect &geometryIn, const QRect &geometry,
57 DWORD style, DWORD exStyle);
58 void applyToMinMaxInfo(MINMAXINFO *mmi) const;
59
61 // The screen to use to scale size constraints, etc. Might differ from the
62 // screen of the window after QPlatformWindow::initialGeometry() (QTBUG-77307).
64 QRect requestedGeometryIn; // QWindow scaled
65 QRect requestedGeometry; // after QPlatformWindow::initialGeometry()
69 QMargins customMargins; // User-defined, additional frame for WM_NCCALCSIZE
70 int frameX = CW_USEDEFAULT; // Passed on to CreateWindowEx(), including frame.
71 int frameY = CW_USEDEFAULT;
72 int frameWidth = CW_USEDEFAULT;
73 int frameHeight = CW_USEDEFAULT;
74 int menuHeight = 0;
75};
76
78{
79 Qt::WindowFlags flags;
83 QMargins fullFrameMargins; // Do not use directly for windows, see FrameDirty.
84 QMargins customMargins; // User-defined, additional frame for NCCALCSIZE
85 HWND hwnd = nullptr;
86 bool embedded = false;
87 bool hasFrame = false;
88
89 static QWindowsWindowData create(const QWindow *w,
90 const QWindowsWindowData &parameters,
91 const QString &title);
92};
93
96{
97 Q_DISABLE_COPY_MOVE(QWindowsBaseWindow)
98public:
99 using TouchWindowTouchType = QNativeInterface::Private::QWindowsApplication::TouchWindowTouchType;
100 using TouchWindowTouchTypes = QNativeInterface::Private::QWindowsApplication::TouchWindowTouchTypes;
101
103
104 WId winId() const override { return WId(handle()); }
105 QRect geometry() const override { return geometry_sys(); }
106 QMargins frameMargins() const override { return fullFrameMargins(); }
107 QPoint mapToGlobal(const QPoint &pos) const override;
108 QPoint mapFromGlobal(const QPoint &pos) const override;
109 virtual QMargins fullFrameMargins() const { return frameMargins_sys(); }
110
111 void setHasBorderInFullScreen(bool border) override;
112 bool hasBorderInFullScreen() const override;
113
114 QMargins customMargins() const override;
115 void setCustomMargins(const QMargins &margins) override;
116
118
119 virtual HWND handle() const = 0;
120 virtual bool isTopLevel() const { return isTopLevel_sys(); }
121
122 unsigned style() const { return GetWindowLongPtr(handle(), GWL_STYLE); }
123 unsigned exStyle() const { return GetWindowLongPtr(handle(), GWL_EXSTYLE); }
124 static bool isRtlLayout(HWND hwnd);
125
127 static HWND handleOf(const QWindow *w);
128
129protected:
130 HWND parentHwnd() const { return GetAncestor(handle(), GA_PARENT); }
131 bool isTopLevel_sys() const;
132 QRect frameGeometry_sys() const;
133 QRect geometry_sys() const;
134 void setGeometry_sys(const QRect &rect) const;
136 std::optional<TouchWindowTouchTypes> touchWindowTouchTypes_sys() const;
137 void hide_sys();
138 void raise_sys();
139 void lower_sys();
140 void setWindowTitle_sys(const QString &title);
141};
142
144{
145public:
147 : QWindowsBaseWindow(window), m_hwnd(GetDesktopWindow()) {}
148
149 QMargins frameMargins() const override { return QMargins(); }
150 bool isTopLevel() const override { return true; }
151
152protected:
153 HWND handle() const override { return m_hwnd; }
154
155private:
156 const HWND m_hwnd;
157};
158
160{
161public:
162 explicit QWindowsForeignWindow(QWindow *window, HWND hwnd);
163
164 void setParent(const QPlatformWindow *window) override;
165 void setGeometry(const QRect &rect) override { setGeometry_sys(rect); }
166 void setVisible(bool visible) override;
167 void raise() override { raise_sys(); }
168 void lower() override { lower_sys(); }
170 bool isForeignWindow() const override { return true; }
171
172protected:
173 HWND handle() const override { return m_hwnd; }
174
175private:
176 const HWND m_hwnd;
177 DWORD m_topLevelStyle;
178};
179
181{
182public:
183 enum Flags
184 {
198 AlertState = 0x8000,
199 Exposed = 0x10000,
200 WithinCreate = 0x20000,
201 WithinMaximize = 0x40000,
203 Compositing = 0x100000,
205 VulkanSurface = 0x400000,
208 Direct3DSurface = 0x2000000,
209 RestoreOverrideCursor = 0x4000000
210 };
211
213 ~QWindowsWindow() override;
214
215 void initialize() override;
216
218
219 QSurfaceFormat format() const override;
220 void setGeometry(const QRect &rect) override;
221 QRect geometry() const override { return m_data.geometry; }
222 QRect normalGeometry() const override;
223 QRect restoreGeometry() const { return m_data.restoreGeometry; }
225
227 QRect preMoveRect() const { return m_data.preMoveGeometry; }
228 void setPreMoveRect(const QRect &rect) { m_data.preMoveGeometry = rect; }
230
231 void setVisible(bool visible) override;
232 bool isVisible() const;
233 bool isExposed() const override { return testFlag(Exposed); }
234 bool isActive() const override;
235 bool isAncestorOf(const QPlatformWindow *child) const override;
236 bool isEmbedded() const override;
237 QPoint mapToGlobal(const QPoint &pos) const override;
238 QPoint mapFromGlobal(const QPoint &pos) const override;
239
240 void setWindowFlags(Qt::WindowFlags flags) override;
241 void setWindowState(Qt::WindowStates state) override;
242
243 void setParent(const QPlatformWindow *window) override;
244
245 void setWindowTitle(const QString &title) override;
246 void raise() override { raise_sys(); }
247 void lower() override { lower_sys(); }
248
249 bool windowEvent(QEvent *event) override;
250
251 void propagateSizeHints() override;
252 static bool handleGeometryChangingMessage(MSG *message, const QWindow *qWindow, const QMargins &marginsDp);
254 QMargins frameMargins() const override;
255 QMargins fullFrameMargins() const override;
256 void setFullFrameMargins(const QMargins &newMargins);
258
259 void setOpacity(qreal level) override;
260 void setMask(const QRegion &region) override;
261 qreal opacity() const { return m_opacity; }
262 void requestActivateWindow() override;
263
264 bool setKeyboardGrabEnabled(bool grab) override;
265 bool setMouseGrabEnabled(bool grab) override;
266 inline bool hasMouseCapture() const { return GetCapture() == m_data.hwnd; }
267
268 bool startSystemResize(Qt::Edges edges) override;
269 bool startSystemMove() override;
270
271 void setFrameStrutEventsEnabled(bool enabled) override;
273
274 // QWindowsBaseWindow overrides
275 HWND handle() const override { return m_data.hwnd; }
276 bool isTopLevel() const override;
277
278 static bool setDarkBorderToWindow(HWND hwnd, bool d);
279 void setDarkBorder(bool d);
280
281 QWindowsMenuBar *menuBar() const;
282 void setMenuBar(QWindowsMenuBar *mb);
283
284 QMargins customMargins() const override;
285 void setCustomMargins(const QMargins &m) override;
286
287 void setStyle(unsigned s) const;
288 void setExStyle(unsigned s) const;
289
290 bool handleWmPaint(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result);
291
292 void handleMoved();
293 void handleResized(int wParam, LPARAM lParam);
294 void handleHidden();
296 void handleDpiScaledSize(WPARAM wParam, LPARAM lParam, LRESULT *result);
297 void handleDpiChanged(HWND hwnd, WPARAM wParam, LPARAM lParam);
298 void handleDpiChangedAfterParent(HWND hwnd);
299
300 static void displayChanged();
301 static void settingsChanged();
303 static QWindowsWindow *windowsWindowOf(const QWindow *w);
304 static QWindow *topLevelOf(QWindow *w);
305 static inline void *userDataOf(HWND hwnd);
306 static inline void setUserDataOf(HWND hwnd, void *ud);
307
308 static bool setWindowLayered(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, qreal opacity);
309 bool isLayered() const;
310
311 HDC getDC();
312 void releaseDC();
313 void getSizeHints(MINMAXINFO *mmi) const;
314 bool handleNonClientHitTest(const QPoint &globalPos, LRESULT *result) const;
315
316#ifndef QT_NO_CURSOR
317 CursorHandlePtr cursor() const { return m_cursor; }
318#endif
319 void setCursor(const CursorHandlePtr &c);
320 void applyCursor();
321
322 inline bool testFlag(unsigned f) const { return (m_flags & f) != 0; }
323 inline void setFlag(unsigned f) const { m_flags |= f; }
324 inline void clearFlag(unsigned f) const { m_flags &= ~f; }
325
326 void setEnabled(bool enabled);
327 bool isEnabled() const;
328 void setWindowIcon(const QIcon &icon) override;
329
330 void *surface(void *nativeConfig, int *err);
331 void invalidateSurface() override;
332 void aboutToMakeCurrent();
333
334 void setAlertState(bool enabled) override;
335 bool isAlertState() const override { return testFlag(AlertState); }
336 void alertWindow(int durationMs = 0);
337 void stopAlertWindow();
338
341
342 void registerTouchWindow();
344 static void setHasBorderInFullScreenDefault(bool border);
345 void setHasBorderInFullScreen(bool border) override;
346 bool hasBorderInFullScreen() const override;
347 static QString formatWindowTitle(const QString &title);
348
351
352 void setSavedDpi(int dpi) { m_savedDpi = dpi; }
353 int savedDpi() const { return m_savedDpi; }
354 qreal dpiRelativeScale(const UINT dpi) const;
355
356private:
357 inline void show_sys() const;
358 inline QWindowsWindowData setWindowFlags_sys(Qt::WindowFlags wt, unsigned flags = 0) const;
359 inline bool isFullScreen_sys() const;
360 inline void setWindowState_sys(Qt::WindowStates newState);
361 inline void setParent_sys(const QPlatformWindow *parent);
362 inline void updateTransientParent() const;
363 void destroyWindow();
364 inline bool isDropSiteEnabled() const { return m_dropTarget != nullptr; }
365 void setDropSiteEnabled(bool enabled);
366 void updateDropSite(bool topLevel);
367 void handleGeometryChange();
368 void handleWindowStateChange(Qt::WindowStates state);
369 inline void destroyIcon();
370 void fireExpose(const QRegion &region, bool force=false);
371 void fireFullExpose(bool force=false);
372 void calculateFullFrameMargins();
373
374 mutable QWindowsWindowData m_data;
376 mutable unsigned m_flags = WithinCreate;
377 HDC m_hdc = nullptr;
378 Qt::WindowStates m_windowState = Qt::WindowNoState;
379 qreal m_opacity = 1;
380#ifndef QT_NO_CURSOR
381 CursorHandlePtr m_cursor;
382#endif
383 QWindowsOleDropTarget *m_dropTarget = nullptr;
384 unsigned m_savedStyle = 0;
385 QRect m_savedFrameGeometry;
386 HICON m_iconSmall = nullptr;
387 HICON m_iconBig = nullptr;
388 void *m_surface = nullptr;
389 int m_savedDpi = 96;
390
391 static bool m_screenForGLInitialized;
392
393#if QT_CONFIG(vulkan)
394 // note: intentionally not using void * in order to avoid breaking x86
395 VkSurfaceKHR m_vkSurface = VK_NULL_HANDLE;
396#endif
397 static bool m_borderInFullScreenDefault;
398 static bool m_inSetgeometry;
399};
400
401#ifndef QT_NO_DEBUG_STREAM
402QDebug operator<<(QDebug d, const RECT &r);
403QDebug operator<<(QDebug d, const POINT &);
404QDebug operator<<(QDebug d, const MINMAXINFO &i);
405QDebug operator<<(QDebug d, const NCCALCSIZE_PARAMS &p);
406QDebug operator<<(QDebug d, const WINDOWPLACEMENT &);
407QDebug operator<<(QDebug d, const WINDOWPOS &);
408QDebug operator<<(QDebug d, const GUID &guid);
409#endif // !QT_NO_DEBUG_STREAM
410
411static inline void clientToScreen(HWND hwnd, POINT *wP)
412{
414 RECT clientArea;
415 GetClientRect(hwnd, &clientArea);
416 wP->x = clientArea.right - wP->x;
417 }
418 ClientToScreen(hwnd, wP);
419}
420
421static inline void screenToClient(HWND hwnd, POINT *wP)
422{
423 ScreenToClient(hwnd, wP);
425 RECT clientArea;
426 GetClientRect(hwnd, &clientArea);
427 wP->x = clientArea.right - wP->x;
428 }
429}
430
431// ---------- QWindowsGeometryHint inline functions.
433{
434 POINT p = { qp.x(), qp.y() };
435 clientToScreen(hwnd, &p);
436 return QPoint(p.x, p.y);
437}
438
440{
441 POINT p = { qp.x(), qp.y() };
442 screenToClient(hwnd, &p);
443 return QPoint(p.x, p.y);
444}
445
448
451
452
453// ---------- QWindowsBaseWindow inline functions.
454
456{
457 if (!w || !w->handle())
458 return nullptr;
459
460 const Qt::WindowType type = w->type();
461 if (type == Qt::Desktop || w->handle()->isForeignWindow())
462 return nullptr;
463
464 return static_cast<QWindowsWindow *>(w->handle());
465}
466
468{
469 return reinterpret_cast<void *>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
470}
471
472void QWindowsWindow::setUserDataOf(HWND hwnd, void *ud)
473{
474 SetWindowLongPtr(hwnd, GWLP_USERDATA, LONG_PTR(ud));
475}
476
477inline void QWindowsWindow::destroyIcon()
478{
479 if (m_iconBig) {
480 DestroyIcon(m_iconBig);
481 m_iconBig = nullptr;
482 }
483 if (m_iconSmall) {
484 DestroyIcon(m_iconSmall);
485 m_iconSmall = nullptr;
486 }
487}
488
489inline bool QWindowsWindow::isLayered() const
490{
491 return GetWindowLongPtr(m_data.hwnd, GWL_EXSTYLE) & WS_EX_LAYERED;
492}
493
495
497
498#endif // QWINDOWSWINDOW_H
\inmodule QtCore
\inmodule QtCore
Definition qcoreevent.h:45
The QIcon class provides scalable icons in different modes and states.
Definition qicon.h:20
\inmodule QtCore
Definition qmargins.h:23
Native interface to QPlatformWindow. \inmodule QtGui.
QSurface * surface() const
The QPlatformWindow class provides an abstraction for top-level windows.
QWindow * window() const
Returns the window which belongs to the QPlatformWindow.
QPlatformScreen * screenForGeometry(const QRect &newGeometry) const
Helper function for finding the new screen for newGeometry in response to a geometry changed event.
QPlatformWindow * parent() const
Returns the parent platform window (or \nullptr if orphan).
\inmodule QtCore\reentrant
Definition qpoint.h:23
constexpr int x() const noexcept
Returns the x coordinate of this point.
Definition qpoint.h:127
constexpr int y() const noexcept
Returns the y coordinate of this point.
Definition qpoint.h:132
\inmodule QtCore
Definition qpointer.h:18
\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.
\inmodule QtGui
Definition qwindow.h:63
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 hasBorderInFullScreen() const override
static QWindowsBaseWindow * baseWindowOf(const QWindow *w)
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)
static bool isRtlLayout(HWND hwnd)
QRect frameGeometry_sys() const
QNativeInterface::Private::QWindowsApplication::TouchWindowTouchTypes TouchWindowTouchTypes
WId winId() const override
Reimplement in subclasses to return a handle to the native window.
QRect geometry_sys() const
virtual HWND handle() const =0
QNativeInterface::Private::QWindowsApplication::TouchWindowTouchType TouchWindowTouchType
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
void setWindowTitle_sys(const QString &title)
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.
void raise() override
Reimplement to be able to let Qt raise windows to the top of the desktop.
Windows native menu bar.
Implementation of IDropTarget.
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 ...
void setPreMoveRect(const QRect &rect)
QMargins fullFrameMargins() const override
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 checkForScreenChanged(ScreenChangeMode mode=FromGeometryChange)
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.
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)
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.
QRect preMoveRect() const
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.
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 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
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...
static QWindow * topTransientOf(QWindow *w)
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 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)
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.
rect
[4]
else opt state
[0]
void newState(QList< State > &states, const char *token, const char *lexem, bool pre)
Combined button and popup list for selecting options.
@ WindowNoState
Definition qnamespace.h:251
WindowType
Definition qnamespace.h:204
@ Desktop
Definition qnamespace.h:214
#define Q_DECLARE_METATYPE(TYPE)
Definition qmetatype.h:1504
GLenum mode
const GLfloat * m
GLenum GLuint GLint level
GLfloat GLfloat GLfloat w
[0]
GLboolean r
[2]
GLint GLenum GLsizei GLsizei GLsizei GLint border
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLfloat GLfloat f
GLenum type
GLbitfield flags
GLuint GLsizei const GLchar * message
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
struct _cl_event * event
const GLubyte * c
GLuint64EXT * result
[6]
GLdouble s
[6]
Definition qopenglext.h:235
GLfloat GLfloat p
[1]
static bool hasAlpha(const QImage &image)
QScreen * screen
[1]
Definition main.cpp:29
double qreal
Definition qtypes.h:92
struct tagMSG MSG
static void clientToScreen(HWND hwnd, POINT *wP)
QDebug operator<<(QDebug d, const RECT &r)
static void screenToClient(HWND hwnd, POINT *wP)
QString title
[35]
QLayoutItem * child
[0]
QFrame frame
[0]
view create()
Active Context for creating windows.
const QScreen * screen
const QWindow * window
void applyToMinMaxInfo(MINMAXINFO *mmi) const
Stores geometry constraints and provides utility functions.
static QMargins frameOnPrimaryScreen(const QWindow *w, DWORD style, DWORD exStyle)
static bool positionIncludesFrame(const QWindow *w)
static void frameSizeConstraints(const QWindow *w, const QScreen *screen, const QMargins &margins, QSize *minimumSize, QSize *maximumSize)
static QPoint mapToGlobal(HWND hwnd, const QPoint &)
static QPoint mapFromGlobal(const HWND hwnd, const QPoint &)
static void applyToMinMaxInfo(const QWindow *w, const QScreen *screen, const QMargins &margins, MINMAXINFO *mmi)
static bool handleCalculateSize(const QMargins &customMargins, const MSG &msg, LRESULT *result)
Qt::WindowFlags flags