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
QWindowsWindow Class Reference

Raster or OpenGL Window. More...

#include <qwindowswindow.h>

Inheritance diagram for QWindowsWindow:
Collaboration diagram for QWindowsWindow:

Public Types

enum  Flags {
  AutoMouseCapture = 0x1 , WithinSetParent = 0x2 , WithinSetGeometry = 0x8 , OpenGLSurface = 0x10 ,
  OpenGLDoubleBuffered = 0x40 , OpenGlPixelFormatInitialized = 0x80 , BlockedByModal = 0x100 , SizeGripOperation = 0x200 ,
  FrameStrutEventsEnabled = 0x400 , SynchronousGeometryChangeEvent = 0x800 , WithinSetStyle = 0x1000 , WithinDestroy = 0x2000 ,
  TouchRegistered = 0x4000 , AlertState = 0x8000 , Exposed = 0x10000 , WithinCreate = 0x20000 ,
  WithinMaximize = 0x40000 , MaximizeToFullScreen = 0x80000 , Compositing = 0x100000 , HasBorderInFullScreen = 0x200000 ,
  VulkanSurface = 0x400000 , ResizeMoveActive = 0x800000 , DisableNonClientScaling = 0x1000000 , Direct3DSurface = 0x2000000 ,
  RestoreOverrideCursor = 0x4000000
}
enum  ScreenChangeMode { FromGeometryChange , FromDpiChange , FromScreenAdded }
Public Types inherited from QWindowsBaseWindow
using TouchWindowTouchType = QNativeInterface::Private::QWindowsApplication::TouchWindowTouchType
using TouchWindowTouchTypes = QNativeInterface::Private::QWindowsApplication::TouchWindowTouchTypes

Public Member Functions

 QWindowsWindow (QWindow *window, const QWindowsWindowData &data)
 ~QWindowsWindow () override
void initialize () override
 Called as part of QWindow::create(), after constructing the window.
QSurfaceFormat format () const override
 Returns the actual surface format of the window.
void setGeometry (const QRect &rect) override
 This function is called by Qt whenever a window is moved or resized using the QWindow API.
QRect geometry () const override
 Returns the current geometry of a window.
QRect normalGeometry () const override
 Returns the geometry of a window in 'normal' state (neither maximized, fullscreen nor minimized) for saving geometries to application settings.
QMargins safeAreaMargins () const override
 The safe area margins of a window represent the area that is safe to place content within, without intersecting areas of the screen where system UI is placed, or where a screen bezel may cover the content.
QRect restoreGeometry () const
void updateRestoreGeometry ()
void setVisible (bool visible) override
 Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
bool isVisible () const
bool isExposed () const override
 Returns if this window is exposed in the windowing system.
bool isActive () const override
 Returns true if the window should appear active from a style perspective.
bool isAncestorOf (const QPlatformWindow *child) const override
 Returns true if the window is an ancestor of the given child.
bool isEmbedded () const override
 Returns true if the window is a child of a non-Qt window.
QPoint mapToGlobal (const QPoint &pos) const override
 Translates the window coordinate pos to global screen coordinates using native methods.
QPoint mapFromGlobal (const QPoint &pos) const override
 Translates the global screen coordinate pos to window coordinates using native methods.
void setWindowFlags (Qt::WindowFlags flags) override
 Requests setting the window flags of this surface to flags.
void setWindowState (Qt::WindowStates state) override
 Requests setting the window state of this surface to type.
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.
QString windowTitle () const override
 Reimplement to return the actual window title used in the underlying windowing system unless the title set for the QWindow which belongs to this QPlatformWindow (i.e.
void raise () override
 Reimplement to be able to let Qt raise windows to the top of the desktop.
void lower () override
 Reimplement to be able to let Qt lower windows to the bottom of the desktop.
bool windowEvent (QEvent *event) override
 Reimplement this method to be able to do any platform specific event handling.
void propagateSizeHints () override
 Reimplement to propagate the size hints of the QWindow.
bool handleGeometryChanging (MSG *message) const
QMargins frameMargins () const override
QMargins fullFrameMargins () const override
void setFullFrameMargins (const QMargins &newMargins)
void updateFullFrameMargins ()
void setOpacity (qreal level) override
 Reimplement to be able to let Qt set the opacity level of a window.
void setMask (const QRegion &region) override
 Reimplement to be able to let Qt set the mask of a window.
qreal opacity () const
void requestActivateWindow () override
 Reimplement to let Qt be able to request activation/focus for a window.
bool setKeyboardGrabEnabled (bool grab) override
bool setMouseGrabEnabled (bool grab) override
bool hasMouseCapture () const
bool startSystemResize (Qt::Edges edges) override
 Reimplement this method to start a system resize operation if the system supports it and return true to indicate success.
bool startSystemMove () override
 Reimplement this method to start a system move operation if the system supports it and return true to indicate success.
void setFrameStrutEventsEnabled (bool enabled) override
 Reimplement this method to set whether frame strut events should be sent to enabled.
bool frameStrutEventsEnabled () const override
 Reimplement this method to return whether frame strut events are enabled.
HWND handle () const override
bool isTopLevel () const override
void setDarkBorder (bool d)
QWindowsMenuBarmenuBar () const
void setMenuBar (QWindowsMenuBar *mb)
QMargins customMargins () const override
void setCustomMargins (const QMargins &m) override
 Sets custom margins to be added to the default margins determined by the windows style in the handling of the WM_NCCALCSIZE message.
void setStyle (unsigned s) const
void setExStyle (unsigned s) const
bool handleWmPaint (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result)
void handleMoved ()
void handleResized (int wParam, LPARAM lParam)
void handleHidden ()
void handleCompositionSettingsChanged ()
void handleDpiScaledSize (WPARAM wParam, LPARAM lParam, LRESULT *result)
void handleDpiChanged (HWND hwnd, WPARAM wParam, LPARAM lParam)
void handleDpiChangedAfterParent (HWND hwnd)
bool isLayered () const
HDC getDC ()
 Allocates a HDC for the window or returns the temporary one obtained from WinAPI BeginPaint within a WM_PAINT event.
void releaseDC ()
 Releases the HDC for the window or does nothing in case it was obtained from WinAPI BeginPaint within a WM_PAINT event.
void getSizeHints (MINMAXINFO *mmi) const
bool handleNonClientHitTest (const QPoint &globalPos, LRESULT *result) const
bool handleNonClientActivate (LRESULT *result) const
void updateCustomTitlebar ()
CursorHandlePtr cursor () const
void setCursor (const CursorHandlePtr &c)
void applyCursor ()
 Applies to cursor property set on the window to the global cursor.
bool testFlag (unsigned f) const
void setFlag (unsigned f) const
void clearFlag (unsigned f) const
void setEnabled (bool enabled)
bool isEnabled () const
void setWindowIcon (const QIcon &icon) override
 Reimplement to set the window icon to icon.
voidsurface (void *nativeConfig, int *err)
void invalidateSurface () override
 Invalidates the window's surface by releasing its surface buffers.
void setAlertState (bool enabled) override
 Reimplement this method to set whether the window demands attention (for example, by flashing the taskbar icon) depending on enabled.
bool isAlertState () const override
 Reimplement this method return whether the window is in an alert state.
void alertWindow (int durationMs=0)
void stopAlertWindow ()
void checkForScreenChanged (ScreenChangeMode mode=FromGeometryChange)
void registerTouchWindow ()
void setHasBorderInFullScreen (bool border) override
bool hasBorderInFullScreen () const override
void setSavedDpi (int dpi)
int savedDpi () const
qreal dpiRelativeScale (const UINT dpi) const
bool isClientAreaExpanded () const
void requestUpdate () override
 Requests an QEvent::UpdateRequest event.
QPlatformScreenscreenForGeometry (const QRect &newGeometry) const
 Helper function for finding the new screen for newGeometry in response to a geometry changed event.
Public Member Functions inherited from QWindowsBaseWindow
 QWindowsBaseWindow (QWindow *window)
WId winId () const override
 Reimplement in subclasses to return a handle to the native window.
void setHasBorderInFullScreen (bool border) override
bool hasBorderInFullScreen () const override
QMargins customMargins () const override
void setCustomMargins (const QMargins &margins) override
unsigned style () const
unsigned exStyle () const
QPlatformScreenscreenForGeometry (const QRect &newGeometry) const
 Helper function for finding the new screen for newGeometry in response to a geometry changed event.
Public Member Functions inherited from QPlatformWindow
 QPlatformWindow (QWindow *window)
 Constructs a platform window with the given top level window.
 ~QPlatformWindow () override
 Virtual destructor does not delete its top level window.
QWindowwindow () const
 Returns the window which belongs to the QPlatformWindow.
QPlatformWindowparent () const
 Returns the parent platform window (or \nullptr if orphan).
QPlatformScreenscreen () const override
 Returns the platform screen handle corresponding to this platform window, or null if the window is not associated with a screen.
virtual void setWindowFilePath (const QString &title)
 Reimplement to set the window file path to filePath.
virtual bool close ()
 Reimplement to let the platform handle non-spontaneous window close.
virtual bool isForeignWindow () const
QPointF mapToGlobalF (const QPointF &pos) const
QPointF mapFromGlobalF (const QPointF &pos) const
virtual void handleContentOrientationChange (Qt::ScreenOrientation orientation)
 Handle changes to the orientation of the platform window's contents.
virtual qreal devicePixelRatio () const
 Reimplement this function in subclass to return the device pixel ratio for the window.
virtual bool setWindowModified (bool modified)
 Reimplement to be able to let Qt indicate that the window has been modified.
bool hasPendingUpdateRequest () const
 Returns true if the window has a pending update request.
virtual void deliverUpdateRequest ()
 Delivers an QEvent::UpdateRequest event to the window.
virtual bool allowsIndependentThreadedRendering () const
 Returns whether applications can render new frames from any thread without co-ordination with the main thread.
QSize windowMinimumSize () const
 Returns the QWindow minimum size.
QSize windowMaximumSize () const
 Returns the QWindow maximum size.
QSize windowBaseSize () const
 Returns the QWindow base size.
QSize windowSizeIncrement () const
 Returns the QWindow size increment.
QRect windowGeometry () const
 Returns the QWindow geometry.
QRect windowFrameGeometry () const
 Returns the QWindow frame geometry.
QRectF windowClosestAcceptableGeometry (const QRectF &nativeRect) const
Public Member Functions inherited from QPlatformSurface
virtual ~QPlatformSurface ()
QSurfacesurface () const

Static Public Member Functions

static bool handleGeometryChangingMessage (MSG *message, const QWindow *qWindow, const QMargins &marginsDp)
static bool setDarkBorderToWindow (HWND hwnd, bool d)
static void displayChanged ()
static void settingsChanged ()
static QScreenforcedScreenForGLWindow (const QWindow *w)
static QWindowsWindowwindowsWindowOf (const QWindow *w)
static QWindowtopLevelOf (QWindow *w)
static voiduserDataOf (HWND hwnd)
static void setUserDataOf (HWND hwnd, void *ud)
static bool hasNoNativeFrame (HWND hwnd, Qt::WindowFlags flags)
static bool setWindowLayered (HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, qreal opacity)
static void setHasBorderInFullScreenStatic (QWindow *window, bool border)
static void setHasBorderInFullScreenDefault (bool border)
static QString formatWindowTitle (const QString &title)
Static Public Member Functions inherited from QWindowsBaseWindow
static bool isRtlLayout (HWND hwnd)
static QWindowsBaseWindowbaseWindowOf (const QWindow *w)
static HWND handleOf (const QWindow *w)
Static Public Member Functions inherited from QPlatformWindow
static QRect initialGeometry (const QWindow *w, const QRect &initialGeometry, int defaultWidth, int defaultHeight, const QScreen **resultingScreenReturn=nullptr)
 Helper function to get initial geometry on windowing systems which do not do smart positioning and also do not provide a means of centering a transient window w.r.t.
static QRectF closestAcceptableGeometry (const QWindow *w, const QRectF &nativeRect)
 Returns the closest acceptable geometry for a given geometry before a resize/move event for platforms that support it, for example to implement heightForWidth().

Static Public Attributes

static const char * embeddedNativeParentHandleProperty = "_q_embedded_native_parent_handle"
static const char * hasBorderInFullScreenProperty = "_q_has_border_in_fullscreen"

Additional Inherited Members

Protected Member Functions inherited from QWindowsBaseWindow
HWND parentHwnd () const
bool isTopLevel_sys () const
bool hasMaximumHeight () const
bool hasMaximumWidth () const
bool hasMaximumSize () const
QRect frameGeometry_sys () const
QRect geometry_sys () const
void setGeometry_sys (const QRect &rect) const
QMargins frameMargins_sys () const
std::optional< TouchWindowTouchTypestouchWindowTouchTypes_sys () const
void hide_sys ()
void raise_sys ()
void lower_sys ()
void setWindowTitle_sys (const QString &title)
Protected Member Functions inherited from QPlatformWindow
QPlatformScreenscreenForGeometry (const QRect &newGeometry) const
 Helper function for finding the new screen for newGeometry in response to a geometry changed event.
Static Protected Member Functions inherited from QPlatformWindow
static QString formatWindowTitle (const QString &title, const QString &separator)
 Call this method to put together a window title composed of title separator the application display name.
static QSize constrainWindowSize (const QSize &size)
 Returns a size with both dimensions bounded to [0, QWINDOWSIZE_MAX].
Protected Attributes inherited from QPlatformWindow
QScopedPointer< QPlatformWindowPrivated_ptr

Detailed Description

Raster or OpenGL Window.

\list

  • Raster type: handleWmPaint() is implemented to to bitblt the image. The DC can be accessed via getDC/releaseDC, which has special handling when within a paint event (in that case, the DC obtained from BeginPaint() is returned).
  • Open GL: The first time QWindowsGLContext accesses the handle, it sets up the pixelformat on the DC which in turn sets it on the window (see flag PixelFormatInitialized). handleWmPaint() is empty (although required). \endlist

Definition at line 186 of file qwindowswindow.h.

Member Enumeration Documentation

◆ Flags

Enumerator
AutoMouseCapture 
WithinSetParent 

Automatic mouse capture on button press.

WithinSetGeometry 
OpenGLSurface 
OpenGLDoubleBuffered 
OpenGlPixelFormatInitialized 
BlockedByModal 
SizeGripOperation 
FrameStrutEventsEnabled 
SynchronousGeometryChangeEvent 
WithinSetStyle 
WithinDestroy 
TouchRegistered 
AlertState 
Exposed 
WithinCreate 
WithinMaximize 
MaximizeToFullScreen 
Compositing 
HasBorderInFullScreen 
VulkanSurface 
ResizeMoveActive 
DisableNonClientScaling 
Direct3DSurface 
RestoreOverrideCursor 

Definition at line 189 of file qwindowswindow.h.

◆ ScreenChangeMode

Enumerator
FromGeometryChange 
FromDpiChange 
FromScreenAdded 

Definition at line 344 of file qwindowswindow.h.

Constructor & Destructor Documentation

◆ QWindowsWindow()

QWindowsWindow::QWindowsWindow ( QWindow * window,
const QWindowsWindowData & data )

Definition at line 1590 of file qwindowswindow.cpp.

References clearFlag(), Direct3DSurface, HasBorderInFullScreen, hasBorderInFullScreenProperty, registerTouchWindow(), setFlag(), and WithinCreate.

Here is the call graph for this function:

◆ ~QWindowsWindow()

QWindowsWindow::~QWindowsWindow ( )
override

Definition at line 1635 of file qwindowswindow.cpp.

References setFlag(), and WithinDestroy.

Here is the call graph for this function:

Member Function Documentation

◆ alertWindow()

void QWindowsWindow::alertWindow ( int durationMs = 0)

Definition at line 3736 of file qwindowswindow.cpp.

Referenced by setAlertState(), and QWindowsContext::windowsProc().

Here is the caller graph for this function:

◆ applyCursor()

void QWindowsWindow::applyCursor ( )

Applies to cursor property set on the window to the global cursor.

See also
QWindowsCursor

Definition at line 3681 of file qwindowswindow.cpp.

References applyCursor(), QWindowsCursor::enforceOverrideCursor(), QWindowsCursor::hasOverrideCursor(), and isTopLevel().

Referenced by applyCursor(), and setCursor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkForScreenChanged()

void QWindowsWindow::checkForScreenChanged ( ScreenChangeMode mode = FromGeometryChange)

Definition at line 2354 of file qwindowswindow.cpp.

References FromGeometryChange, QWindowsContext::instance(), QWindowsScreenManager::isSingleScreen(), QWindowsContext::screenManager(), and updateFullFrameMargins().

Referenced by handleDpiChanged(), handleDpiChangedAfterParent(), and QWindowsContext::windowsProc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearFlag()

void QWindowsWindow::clearFlag ( unsigned f) const
inline

Definition at line 330 of file qwindowswindow.h.

Referenced by QWindowsWindow(), setAlertState(), setCursor(), setFrameStrutEventsEnabled(), setGeometry(), setHasBorderInFullScreen(), setMouseGrabEnabled(), setStyle(), windowEvent(), and QWindowsContext::windowsProc().

Here is the caller graph for this function:

◆ cursor()

CursorHandlePtr QWindowsWindow::cursor ( ) const
inline

Definition at line 323 of file qwindowswindow.h.

◆ customMargins()

QMargins QWindowsWindow::customMargins ( ) const
override

Returns the margin to be used when handling the WM_NCCALCSIZE message.

Definition at line 3848 of file qwindowswindow.cpp.

◆ displayChanged()

void QWindowsWindow::displayChanged ( )
static

Definition at line 1781 of file qwindowswindow.cpp.

◆ dpiRelativeScale()

qreal QWindowsWindow::dpiRelativeScale ( const UINT dpi) const

Definition at line 2075 of file qwindowswindow.cpp.

◆ forcedScreenForGLWindow()

QScreen * QWindowsWindow::forcedScreenForGLWindow ( const QWindow * w)
static

Definition at line 1791 of file qwindowswindow.cpp.

References GpuDescription::detect().

Here is the call graph for this function:

◆ format()

QSurfaceFormat QWindowsWindow::format ( ) const
overridevirtual

Returns the actual surface format of the window.

Reimplemented from QPlatformWindow.

Definition at line 1670 of file qwindowswindow.cpp.

◆ formatWindowTitle()

QString QWindowsWindow::formatWindowTitle ( const QString & title)
static

Definition at line 3999 of file qwindowswindow.cpp.

◆ frameMargins()

QMargins QWindowsWindow::frameMargins ( ) const
overridevirtual

Reimplemented from QWindowsBaseWindow.

Definition at line 3045 of file qwindowswindow.cpp.

◆ frameStrutEventsEnabled()

bool QWindowsWindow::frameStrutEventsEnabled ( ) const
inlineoverridevirtual

Reimplement this method to return whether frame strut events are enabled.

Reimplemented from QPlatformWindow.

Definition at line 275 of file qwindowswindow.h.

References FrameStrutEventsEnabled, and testFlag().

Referenced by QWindowsContext::windowsProc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fullFrameMargins()

QMargins QWindowsWindow::fullFrameMargins ( ) const
overridevirtual

Reimplemented from QWindowsBaseWindow.

Definition at line 3053 of file qwindowswindow.cpp.

◆ geometry()

QRect QWindowsWindow::geometry ( ) const
inlineoverridevirtual

Returns the current geometry of a window.

Reimplemented from QWindowsBaseWindow.

Definition at line 227 of file qwindowswindow.h.

◆ getDC()

HDC QWindowsWindow::getDC ( )

Allocates a HDC for the window or returns the temporary one obtained from WinAPI BeginPaint within a WM_PAINT event.

See also
releaseDC()

Definition at line 2461 of file qwindowswindow.cpp.

◆ getSizeHints()

void QWindowsWindow::getSizeHints ( MINMAXINFO * mmi) const

Definition at line 3286 of file qwindowswindow.cpp.

◆ handle()

HWND QWindowsWindow::handle ( ) const
inlineoverridevirtual

Implements QWindowsBaseWindow.

Definition at line 278 of file qwindowswindow.h.

◆ handleCompositionSettingsChanged()

void QWindowsWindow::handleCompositionSettingsChanged ( )

Definition at line 2068 of file qwindowswindow.cpp.

Referenced by QWindowsContext::windowsProc().

Here is the caller graph for this function:

◆ handleDpiChanged()

void QWindowsWindow::handleDpiChanged ( HWND hwnd,
WPARAM wParam,
LPARAM lParam )

Definition at line 2107 of file qwindowswindow.cpp.

References checkForScreenChanged(), FromDpiChange, setSavedDpi(), and updateFullFrameMargins().

Here is the call graph for this function:

◆ handleDpiChangedAfterParent()

void QWindowsWindow::handleDpiChangedAfterParent ( HWND hwnd)

Definition at line 2155 of file qwindowswindow.cpp.

References checkForScreenChanged(), FromDpiChange, and setSavedDpi().

Here is the call graph for this function:

◆ handleDpiScaledSize()

void QWindowsWindow::handleDpiScaledSize ( WPARAM wParam,
LPARAM lParam,
LRESULT * result )

Definition at line 2081 of file qwindowswindow.cpp.

◆ handleGeometryChanging()

bool QWindowsWindow::handleGeometryChanging ( MSG * message) const

Definition at line 2975 of file qwindowswindow.cpp.

◆ handleGeometryChangingMessage()

bool QWindowsWindow::handleGeometryChangingMessage ( MSG * message,
const QWindow * qWindow,
const QMargins & marginsDp )
static

Definition at line 2933 of file qwindowswindow.cpp.

◆ handleHidden()

void QWindowsWindow::handleHidden ( )

Definition at line 2063 of file qwindowswindow.cpp.

Referenced by QWindowsContext::windowsProc().

Here is the caller graph for this function:

◆ handleMoved()

void QWindowsWindow::handleMoved ( )

Definition at line 2279 of file qwindowswindow.cpp.

Referenced by QWindowsContext::windowsProc().

Here is the caller graph for this function:

◆ handleNonClientActivate()

bool QWindowsWindow::handleNonClientActivate ( LRESULT * result) const

Definition at line 3475 of file qwindowswindow.cpp.

◆ handleNonClientHitTest()

bool QWindowsWindow::handleNonClientHitTest ( const QPoint & globalPos,
LRESULT * result ) const

Definition at line 3292 of file qwindowswindow.cpp.

◆ handleResized()

void QWindowsWindow::handleResized ( int wParam,
LPARAM lParam )

Definition at line 2286 of file qwindowswindow.cpp.

References testFlag(), WithinSetGeometry, and WithinSetStyle.

Here is the call graph for this function:

◆ handleWmPaint()

bool QWindowsWindow::handleWmPaint ( HWND hwnd,
UINT message,
WPARAM wParam,
LPARAM lParam,
LRESULT * result )

Definition at line 2496 of file qwindowswindow.cpp.

References isSoftwareGl(), OpenGLSurface, and testFlag().

Here is the call graph for this function:

◆ hasBorderInFullScreen()

bool QWindowsWindow::hasBorderInFullScreen ( ) const
override

Returns whether the WS_BORDER flag will be set for the window in full screen mode.

Definition at line 3975 of file qwindowswindow.cpp.

References HasBorderInFullScreen, and testFlag().

Referenced by setHasBorderInFullScreen().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasMouseCapture()

bool QWindowsWindow::hasMouseCapture ( ) const
inline

Definition at line 269 of file qwindowswindow.h.

Referenced by setMouseGrabEnabled(), setVisible(), startDoDragDrop(), and windowEvent().

Here is the caller graph for this function:

◆ hasNoNativeFrame()

bool QWindowsWindow::hasNoNativeFrame ( HWND hwnd,
Qt::WindowFlags flags )
static

Definition at line 480 of file qwindowswindow.cpp.

◆ initialize()

void QWindowsWindow::initialize ( )
overridevirtual

Called as part of QWindow::create(), after constructing the window.

Platforms should prefer to do initialization here instead of in the constructor, as the platform window object will be fully constructed, and associated to the corresponding QWindow, allowing synchronous event delivery.

Reimplemented from QPlatformWindow.

Definition at line 1647 of file qwindowswindow.cpp.

References QWindowsContext::instance().

Here is the call graph for this function:

◆ invalidateSurface()

void QWindowsWindow::invalidateSurface ( )
overridevirtual

Invalidates the window's surface by releasing its surface buffers.

Many platforms do not support releasing the surface memory, and the default implementation does nothing.

The platform window is expected to recreate the surface again if it is needed. For instance, if an OpenGL context is made current on this window.

Reimplemented from QPlatformWindow.

Definition at line 3919 of file qwindowswindow.cpp.

References QWindowsStaticOpenGLContext::destroyWindowSurface(), and QWindowsIntegration::staticOpenGLContext().

Here is the call graph for this function:

◆ isActive()

bool QWindowsWindow::isActive ( ) const
overridevirtual

Returns true if the window should appear active from a style perspective.

This function can make platform-specific isActive checks, such as checking if the QWindow is embedded in an active native window.

Reimplemented from QPlatformWindow.

Definition at line 1872 of file qwindowswindow.cpp.

◆ isAlertState()

bool QWindowsWindow::isAlertState ( ) const
inlineoverridevirtual

Reimplement this method return whether the window is in an alert state.

See also
setAlertState()
Since
5.1

Reimplemented from QPlatformWindow.

Definition at line 340 of file qwindowswindow.h.

References AlertState, and testFlag().

Referenced by setAlertState().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isAncestorOf()

bool QWindowsWindow::isAncestorOf ( const QPlatformWindow * child) const
overridevirtual

Returns true if the window is an ancestor of the given child.

Platform overrides should iterate the native window hierarchy of the child, to ensure that ancestary is reflected even with native windows in the window hierarchy.

Reimplemented from QPlatformWindow.

Definition at line 1881 of file qwindowswindow.cpp.

◆ isClientAreaExpanded()

bool QWindowsWindow::isClientAreaExpanded ( ) const
inline

Definition at line 361 of file qwindowswindow.h.

◆ isEmbedded()

bool QWindowsWindow::isEmbedded ( ) const
overridevirtual

Returns true if the window is a child of a non-Qt window.

A embedded window has no parent platform window as reflected though parent(), but will have a native parent window.

Reimplemented from QPlatformWindow.

Definition at line 1887 of file qwindowswindow.cpp.

◆ isEnabled()

bool QWindowsWindow::isEnabled ( ) const

Definition at line 3762 of file qwindowswindow.cpp.

◆ isExposed()

bool QWindowsWindow::isExposed ( ) const
inlineoverridevirtual

Returns if this window is exposed in the windowing system.

An exposeEvent() is sent every time this value changes.

Reimplemented from QPlatformWindow.

Definition at line 235 of file qwindowswindow.h.

References Exposed, and testFlag().

Here is the call graph for this function:

◆ isLayered()

bool QWindowsWindow::isLayered ( ) const
inline

Definition at line 499 of file qwindowswindow.h.

Referenced by setVisible().

Here is the caller graph for this function:

◆ isTopLevel()

bool QWindowsWindow::isTopLevel ( ) const
overridevirtual

Reimplemented from QWindowsBaseWindow.

Definition at line 3809 of file qwindowswindow.cpp.

Referenced by applyCursor().

Here is the caller graph for this function:

◆ isVisible()

bool QWindowsWindow::isVisible ( ) const

Definition at line 1867 of file qwindowswindow.cpp.

Referenced by setMouseGrabEnabled().

Here is the caller graph for this function:

◆ lower()

void QWindowsWindow::lower ( )
inlineoverridevirtual

Reimplement to be able to let Qt lower windows to the bottom of the desktop.

Reimplemented from QPlatformWindow.

Definition at line 250 of file qwindowswindow.h.

References QWindowsBaseWindow::lower_sys().

Here is the call graph for this function:

◆ mapFromGlobal()

QPoint QWindowsWindow::mapFromGlobal ( const QPoint & pos) const
overridevirtual

Translates the global screen coordinate pos to window coordinates using native methods.

This is required for embedded windows, where the topmost QWindow coordinates are not global screen coordinates.

Returns pos if there is no platform specific implementation.

Reimplemented from QWindowsBaseWindow.

Definition at line 1897 of file qwindowswindow.cpp.

◆ mapToGlobal()

QPoint QWindowsWindow::mapToGlobal ( const QPoint & pos) const
overridevirtual

Translates the window coordinate pos to global screen coordinates using native methods.

This is required for embedded windows, where the topmost QWindow coordinates are not global screen coordinates.

Returns pos if there is no platform specific implementation.

Reimplemented from QWindowsBaseWindow.

Definition at line 1892 of file qwindowswindow.cpp.

◆ menuBar()

QWindowsMenuBar * QWindowsWindow::menuBar ( ) const

Definition at line 3838 of file qwindowswindow.cpp.

Referenced by QWindowsContext::windowsProc().

Here is the caller graph for this function:

◆ normalGeometry()

QRect QWindowsWindow::normalGeometry ( ) const
overridevirtual

Returns the geometry of a window in 'normal' state (neither maximized, fullscreen nor minimized) for saving geometries to application settings.

Since
5.3

Reimplemented from QPlatformWindow.

Definition at line 2181 of file qwindowswindow.cpp.

◆ opacity()

qreal QWindowsWindow::opacity ( ) const
inline

Definition at line 264 of file qwindowswindow.h.

◆ propagateSizeHints()

void QWindowsWindow::propagateSizeHints ( )
overridevirtual

Reimplement to propagate the size hints of the QWindow.

The size hints include QWindow::minimumSize(), QWindow::maximumSize(), QWindow::sizeIncrement(), and QWindow::baseSize().

Reimplemented from QPlatformWindow.

Definition at line 2917 of file qwindowswindow.cpp.

◆ raise()

void QWindowsWindow::raise ( )
inlineoverridevirtual

Reimplement to be able to let Qt raise windows to the top of the desktop.

Reimplemented from QPlatformWindow.

Definition at line 249 of file qwindowswindow.h.

References QWindowsBaseWindow::raise_sys().

Here is the call graph for this function:

◆ registerTouchWindow()

void QWindowsWindow::registerTouchWindow ( )

Definition at line 3938 of file qwindowswindow.cpp.

References QWindowsContext::instance(), QWindowsIntegration::instance(), setFlag(), QWindowsContext::SI_SupportsTouch, QWindowsContext::systemInfo(), testFlag(), and TouchRegistered.

Referenced by QWindowsWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ releaseDC()

void QWindowsWindow::releaseDC ( )

Releases the HDC for the window or does nothing in case it was obtained from WinAPI BeginPaint within a WM_PAINT event.

See also
getDC()

Definition at line 2478 of file qwindowswindow.cpp.

◆ requestActivateWindow()

void QWindowsWindow::requestActivateWindow ( )
overridevirtual

Reimplement to let Qt be able to request activation/focus for a window.

Some window systems will probably not have callbacks for this functionality, and then calling QWindowSystemInterface::handleFocusWindowChanged(QWindow *w) would be sufficient.

If the window system has some event handling/callbacks then call QWindowSystemInterface::handleFocusWindowChanged(QWindow *w) when the window system gives the notification.

Default implementation calls QWindowSystem::handleFocusWindowChanged(QWindow *w)

Reimplemented from QPlatformWindow.

Definition at line 3120 of file qwindowswindow.cpp.

References QWindowsIntegration::instance().

Here is the call graph for this function:

◆ requestUpdate()

void QWindowsWindow::requestUpdate ( )
overridevirtual

Requests an QEvent::UpdateRequest event.

The event will be delivered to the QWindow.

QPlatformWindow subclasses can re-implement this function to provide display refresh synchronized updates. The event should be delivered using QPlatformWindow::deliverUpdateRequest() to not get out of sync with the internal state of QWindow.

The default implementation posts an UpdateRequest event to the window after an interval that is at most 5 ms. If the window's associated screen reports a \l{QPlatformScreen::refreshRate()}{refresh rate} higher than 60 Hz, the interval is scaled down to a valid smaller than 5. The additional time is there to give the event loop a bit of idle time to gather system events.

Reimplemented from QPlatformWindow.

Definition at line 4004 of file qwindowswindow.cpp.

◆ restoreGeometry()

QRect QWindowsWindow::restoreGeometry ( ) const
inline

Definition at line 230 of file qwindowswindow.h.

◆ safeAreaMargins()

QMargins QWindowsWindow::safeAreaMargins ( ) const
overridevirtual

The safe area margins of a window represent the area that is safe to place content within, without intersecting areas of the screen where system UI is placed, or where a screen bezel may cover the content.

Reimplemented from QPlatformWindow.

Definition at line 2193 of file qwindowswindow.cpp.

◆ savedDpi()

int QWindowsWindow::savedDpi ( ) const
inline

Definition at line 358 of file qwindowswindow.h.

◆ screenForGeometry()

QPlatformScreen * QPlatformWindow::screenForGeometry ( const QRect & newGeometry) const

Helper function for finding the new screen for newGeometry in response to a geometry changed event.

Returns the new screen if the window was moved to another virtual sibling. If the screen changes, the platform plugin should call QWindowSystemInterface::handleWindowScreenChanged().

Note
: The current screen will always be returned for child windows since they should never signal screen changes.
Since
5.4
See also
QWindowSystemInterface::handleWindowScreenChanged()

Definition at line 136 of file qplatformwindow.cpp.

◆ setAlertState()

void QWindowsWindow::setAlertState ( bool enable)
overridevirtual

Reimplement this method to set whether the window demands attention (for example, by flashing the taskbar icon) depending on enabled.

See also
isAlertState()
Since
5.1

Reimplemented from QPlatformWindow.

Definition at line 3723 of file qwindowswindow.cpp.

References AlertState, alertWindow(), clearFlag(), isAlertState(), setFlag(), and stopAlertWindow().

Here is the call graph for this function:

◆ setCursor()

void QWindowsWindow::setCursor ( const CursorHandlePtr & c)

Definition at line 3702 of file qwindowswindow.cpp.

References applyCursor(), clearFlag(), RestoreOverrideCursor, and testFlag().

Here is the call graph for this function:

◆ setCustomMargins()

void QWindowsWindow::setCustomMargins ( const QMargins & newCustomMargins)
override

Sets custom margins to be added to the default margins determined by the windows style in the handling of the WM_NCCALCSIZE message.

Sets themargins to be used when handling the WM_NCCALCSIZE message. It is possible to remove a frame border by specifying a negative value.

This is currently used to give the Aero-style QWizard a smaller top margin. The property can be set using QPlatformNativeInterface::setWindowProperty() or, before platform window creation, by setting a dynamic property on the QWindow (see QWindowsIntegration::createPlatformWindow()).

Definition at line 3865 of file qwindowswindow.cpp.

◆ setDarkBorder()

void QWindowsWindow::setDarkBorder ( bool d)

Definition at line 3830 of file qwindowswindow.cpp.

◆ setDarkBorderToWindow()

bool QWindowsWindow::setDarkBorderToWindow ( HWND hwnd,
bool d )
static

◆ setEnabled()

void QWindowsWindow::setEnabled ( bool enabled)

Definition at line 3767 of file qwindowswindow.cpp.

References setStyle(), and QWindowsBaseWindow::style().

Referenced by windowEvent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setExStyle()

void QWindowsWindow::setExStyle ( unsigned s) const

Definition at line 2888 of file qwindowswindow.cpp.

◆ setFlag()

void QWindowsWindow::setFlag ( unsigned f) const
inline

Definition at line 329 of file qwindowswindow.h.

Referenced by QWindowsWindow(), ~QWindowsWindow(), QWindowsIntegration::createPlatformWindow(), registerTouchWindow(), setAlertState(), setFrameStrutEventsEnabled(), setGeometry(), setHasBorderInFullScreen(), setStyle(), startSystemResize(), windowEvent(), and QWindowsContext::windowsProc().

Here is the caller graph for this function:

◆ setFrameStrutEventsEnabled()

void QWindowsWindow::setFrameStrutEventsEnabled ( bool enabled)
overridevirtual

Reimplement this method to set whether frame strut events should be sent to enabled.

See also
frameStrutEventsEnabled

Reimplemented from QPlatformWindow.

Definition at line 3277 of file qwindowswindow.cpp.

References clearFlag(), FrameStrutEventsEnabled, and setFlag().

Here is the call graph for this function:

◆ setFullFrameMargins()

void QWindowsWindow::setFullFrameMargins ( const QMargins & newMargins)

Definition at line 2981 of file qwindowswindow.cpp.

◆ setGeometry()

void QWindowsWindow::setGeometry ( const QRect & rect)
overridevirtual

This function is called by Qt whenever a window is moved or resized using the QWindow API.

Unless you also override QPlatformWindow::geometry(), you need to call the baseclass implementation of this function in any override of QPlatformWindow::setGeometry(), as QWindow::geometry() is expected to report back the set geometry until a confirmation (or rejection) of the new geometry comes back from the window manager and is reported via QWindowSystemInterface::handleGeometryChange().

Window move/resizes can also be triggered spontaneously by the window manager, or as a response to an earlier requested move/resize via the Qt APIs. There is no need to call this function from the window manager callback, instead call QWindowSystemInterface::handleGeometryChange().

The position(x, y) part of the rect might be inclusive or exclusive of the window frame as returned by frameMargins(). You can detect this in the plugin by checking qt_window_private(window())->positionPolicy.

Reimplemented from QPlatformWindow.

Definition at line 2248 of file qwindowswindow.cpp.

References clearFlag(), setFlag(), and WithinSetGeometry.

Here is the call graph for this function:

◆ setHasBorderInFullScreen()

void QWindowsWindow::setHasBorderInFullScreen ( bool border)
override

Sets whether the WS_BORDER flag will be set for the window in full screen mode to border.

See also \l [QtDoc] {Fullscreen OpenGL Based Windows}

Definition at line 3980 of file qwindowswindow.cpp.

References clearFlag(), HasBorderInFullScreen, hasBorderInFullScreen(), and setFlag().

Here is the call graph for this function:

◆ setHasBorderInFullScreenDefault()

void QWindowsWindow::setHasBorderInFullScreenDefault ( bool border)
static

Definition at line 3970 of file qwindowswindow.cpp.

Referenced by QWindowsApplication::setHasBorderInFullScreenDefault().

Here is the caller graph for this function:

◆ setHasBorderInFullScreenStatic()

void QWindowsWindow::setHasBorderInFullScreenStatic ( QWindow * window,
bool border )
static

Definition at line 3962 of file qwindowswindow.cpp.

References hasBorderInFullScreenProperty.

◆ setKeyboardGrabEnabled()

bool QWindowsWindow::setKeyboardGrabEnabled ( bool grab)
overridevirtual

Reimplemented from QPlatformWindow.

Definition at line 3194 of file qwindowswindow.cpp.

References QWindowsContext::instance().

Here is the call graph for this function:

◆ setMask()

void QWindowsWindow::setMask ( const QRegion & region)
overridevirtual

Reimplement to be able to let Qt set the mask of a window.

Reimplemented from QPlatformWindow.

Definition at line 3101 of file qwindowswindow.cpp.

◆ setMenuBar()

void QWindowsWindow::setMenuBar ( QWindowsMenuBar * mb)

Definition at line 3843 of file qwindowswindow.cpp.

Referenced by QWindowsMenuBar::install().

Here is the caller graph for this function:

◆ setMouseGrabEnabled()

bool QWindowsWindow::setMouseGrabEnabled ( bool grab)
overridevirtual

Reimplemented from QPlatformWindow.

Definition at line 3212 of file qwindowswindow.cpp.

References AutoMouseCapture, clearFlag(), hasMouseCapture(), and isVisible().

Referenced by setVisible().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setOpacity()

void QWindowsWindow::setOpacity ( qreal level)
overridevirtual

Reimplement to be able to let Qt set the opacity level of a window.

Reimplemented from QPlatformWindow.

Definition at line 3060 of file qwindowswindow.cpp.

◆ setParent()

void QWindowsWindow::setParent ( const QPlatformWindow * parent)
overridevirtual

This function is called to enable native child window in QPA.

It is common not to support this feature in Window systems, but can be faked. When this function is called all geometry of this platform window will be relative to the parent.

Reimplemented from QPlatformWindow.

Definition at line 2018 of file qwindowswindow.cpp.

◆ setSavedDpi()

void QWindowsWindow::setSavedDpi ( int dpi)
inline

Definition at line 357 of file qwindowswindow.h.

Referenced by handleDpiChanged(), and handleDpiChangedAfterParent().

Here is the caller graph for this function:

◆ setStyle()

void QWindowsWindow::setStyle ( unsigned s) const

Definition at line 2880 of file qwindowswindow.cpp.

References clearFlag(), setFlag(), and WithinSetStyle.

Referenced by setEnabled().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ settingsChanged()

void QWindowsWindow::settingsChanged ( )
static

Definition at line 1786 of file qwindowswindow.cpp.

Referenced by QWindowsContext::windowsProc().

Here is the caller graph for this function:

◆ setUserDataOf()

void QWindowsWindow::setUserDataOf ( HWND hwnd,
void * ud )
inlinestatic

Definition at line 482 of file qwindowswindow.h.

◆ setVisible()

void QWindowsWindow::setVisible ( bool visible)
overridevirtual

Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.

The default implementation sends a synchronous expose event.

Reimplemented from QPlatformWindow.

Definition at line 1837 of file qwindowswindow.cpp.

References hasMouseCapture(), QWindowsBaseWindow::hide_sys(), isLayered(), and setMouseGrabEnabled().

Here is the call graph for this function:

◆ setWindowFlags()

void QWindowsWindow::setWindowFlags ( Qt::WindowFlags flags)
overridevirtual

Requests setting the window flags of this surface to flags.

Reimplemented from QPlatformWindow.

Definition at line 2540 of file qwindowswindow.cpp.

◆ setWindowIcon()

void QWindowsWindow::setWindowIcon ( const QIcon & icon)
overridevirtual

Reimplement to set the window icon to icon.

Reimplemented from QPlatformWindow.

Definition at line 3791 of file qwindowswindow.cpp.

◆ setWindowLayered()

bool QWindowsWindow::setWindowLayered ( HWND hwnd,
Qt::WindowFlags flags,
bool hasAlpha,
qreal opacity )
static

Definition at line 489 of file qwindowswindow.cpp.

◆ setWindowState()

void QWindowsWindow::setWindowState ( Qt::WindowStates state)
overridevirtual

Requests setting the window state of this surface to type.

Qt::WindowActive can be ignored.

Reimplemented from QPlatformWindow.

Definition at line 2703 of file qwindowswindow.cpp.

◆ setWindowTitle()

void QWindowsWindow::setWindowTitle ( const QString & title)
overridevirtual

Reimplement to set the window title to title.

The implementation might want to append the application display name to the window title, like Windows and Linux do.

\l QPlatformWindow::windowTitle() can be used to retrieve the actual window title.

See also
QGuiApplication::applicationDisplayName()
QPlatformWindow::windowTitle()

Reimplemented from QPlatformWindow.

Definition at line 2529 of file qwindowswindow.cpp.

◆ startSystemMove()

bool QWindowsWindow::startSystemMove ( )
overridevirtual

Reimplement this method to start a system move operation if the system supports it and return true to indicate success.

The default implementation is empty and does nothing.

Since
5.15

Reimplemented from QPlatformWindow.

Definition at line 3270 of file qwindowswindow.cpp.

◆ startSystemResize()

bool QWindowsWindow::startSystemResize ( Qt::Edges edges)
overridevirtual

Reimplement this method to start a system resize operation if the system supports it and return true to indicate success.

The default implementation is empty and does nothing with edges.

Since
5.15

Reimplemented from QPlatformWindow.

Definition at line 3259 of file qwindowswindow.cpp.

References setFlag(), and SizeGripOperation.

Here is the call graph for this function:

◆ stopAlertWindow()

void QWindowsWindow::stopAlertWindow ( )

Definition at line 3751 of file qwindowswindow.cpp.

Referenced by setAlertState().

Here is the caller graph for this function:

◆ surface()

void * QWindowsWindow::surface ( void * nativeConfig,
int * err )

Definition at line 3885 of file qwindowswindow.cpp.

◆ testFlag()

bool QWindowsWindow::testFlag ( unsigned f) const
inline

Definition at line 328 of file qwindowswindow.h.

Referenced by frameStrutEventsEnabled(), handleResized(), handleWmPaint(), hasBorderInFullScreen(), isAlertState(), isExposed(), isValidWheelReceiver(), registerTouchWindow(), setCursor(), and QWindowsContext::windowsProc().

Here is the caller graph for this function:

◆ topLevelOf()

QWindow * QWindowsWindow::topLevelOf ( QWindow * w)
static

Definition at line 1803 of file qwindowswindow.cpp.

References QWindowsContext::instance().

Here is the call graph for this function:

◆ updateCustomTitlebar()

void QWindowsWindow::updateCustomTitlebar ( )

Definition at line 3487 of file qwindowswindow.cpp.

References QWindowsIntegration::instance().

Referenced by QWindowsContext::windowsProc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateFullFrameMargins()

void QWindowsWindow::updateFullFrameMargins ( )

Definition at line 2991 of file qwindowswindow.cpp.

Referenced by checkForScreenChanged(), and handleDpiChanged().

Here is the caller graph for this function:

◆ updateRestoreGeometry()

void QWindowsWindow::updateRestoreGeometry ( )

Definition at line 2698 of file qwindowswindow.cpp.

Referenced by QWindowsContext::windowsProc().

Here is the caller graph for this function:

◆ userDataOf()

void * QWindowsWindow::userDataOf ( HWND hwnd)
inlinestatic

Definition at line 477 of file qwindowswindow.h.

◆ windowEvent()

bool QWindowsWindow::windowEvent ( QEvent * event)
overridevirtual

Reimplement this method to be able to do any platform specific event handling.

All non-synthetic events for window() are passed to this function before being sent to QWindow::event().

Return true if the event should not be passed on to the QWindow.

Subclasses should always call the base class implementation.

Reimplemented from QWindowsBaseWindow.

Definition at line 2894 of file qwindowswindow.cpp.

References BlockedByModal, clearFlag(), hasMouseCapture(), setEnabled(), and setFlag().

Here is the call graph for this function:

◆ windowsWindowOf()

QWindowsWindow * QWindowsWindow::windowsWindowOf ( const QWindow * w)
inlinestatic

Definition at line 469 of file qwindowswindow.h.

◆ windowTitle()

QString QWindowsWindow::windowTitle ( ) const
overridevirtual

Reimplement to return the actual window title used in the underlying windowing system unless the title set for the QWindow which belongs to this QPlatformWindow (i.e.

the window returned by \l QPlatformWindow::window) is always used without modification.

See also
QPlatformWindow::setWindowTitle()
Since
6.9

Reimplemented from QPlatformWindow.

Definition at line 2535 of file qwindowswindow.cpp.

Member Data Documentation

◆ embeddedNativeParentHandleProperty

const char * QWindowsWindow::embeddedNativeParentHandleProperty = "_q_embedded_native_parent_handle"
static

Definition at line 354 of file qwindowswindow.h.

Referenced by QWindowsContext::shouldHaveNonClientDpiScaling().

◆ hasBorderInFullScreenProperty

const char * QWindowsWindow::hasBorderInFullScreenProperty = "_q_has_border_in_fullscreen"
static

Definition at line 355 of file qwindowswindow.h.

Referenced by QWindowsWindow(), and setHasBorderInFullScreenStatic().


The documentation for this class was generated from the following files: