Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
Raster or OpenGL Window. More...
#include <qwindowswindow.h>
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. | |
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. | |
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 ®ion) 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) |
QWindowsMenuBar * | menuBar () 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 |
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. | |
void * | surface (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 |
QPlatformScreen * | screenForGeometry (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 |
QPlatformScreen * | screenForGeometry (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. | |
QWindow * | window () const |
Returns the window which belongs to the QPlatformWindow. | |
QPlatformWindow * | parent () const |
Returns the parent platform window (or \nullptr if orphan). | |
QPlatformScreen * | screen () const override |
Returns the platform screen handle corresponding to this platform window, or null if the window is not associated with a screen. | |
virtual QMargins | safeAreaMargins () const |
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. | |
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. | |
virtual void | requestUpdate () |
Requests an QEvent::UpdateRequest event. | |
bool | hasPendingUpdateRequest () const |
Returns true if the window has a pending update request. | |
virtual void | deliverUpdateRequest () |
Delivers an QEvent::UpdateRequest event to the window. | |
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 () |
QSurface * | surface () 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 QScreen * | forcedScreenForGLWindow (const QWindow *w) |
static QWindowsWindow * | windowsWindowOf (const QWindow *w) |
static QWindow * | topLevelOf (QWindow *w) |
static void * | userDataOf (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 QWindowsBaseWindow * | baseWindowOf (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 Member Functions inherited from QPlatformSurface | |
static bool | isRasterSurface (QSurface *surface) |
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 |
QRect | frameGeometry_sys () const |
QRect | geometry_sys () const |
void | setGeometry_sys (const QRect &rect) const |
QMargins | frameMargins_sys () const |
std::optional< TouchWindowTouchTypes > | touchWindowTouchTypes_sys () const |
void | hide_sys () |
void | raise_sys () |
void | lower_sys () |
void | setWindowTitle_sys (const QString &title) |
Protected Member Functions inherited from QPlatformWindow | |
QPlatformScreen * | screenForGeometry (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< QPlatformWindowPrivate > | d_ptr |
Raster or OpenGL Window.
\list
Definition at line 179 of file qwindowswindow.h.
Definition at line 182 of file qwindowswindow.h.
Enumerator | |
---|---|
FromGeometryChange | |
FromDpiChange |
Definition at line 333 of file qwindowswindow.h.
QWindowsWindow::QWindowsWindow | ( | QWindow * | window, |
const QWindowsWindowData & | data ) |
Definition at line 1493 of file qwindowswindow.cpp.
References clearFlag(), Qt::Desktop, QSurface::Direct3DSurface, Direct3DSurface, HasBorderInFullScreen, hasBorderInFullScreenProperty, QWindowsWindowData::hwnd, QWindowsContext::instance(), isTopLevel(), opacity(), QSurface::OpenGLSurface, OpenGLSurface, qFuzzyCompare(), qt_window_private(), registerTouchWindow(), setFlag(), setMask(), setOpacity(), setWindowIcon(), QHighDpi::toNativeLocalRegion(), QWindowsBaseWindow::touchWindowTouchTypes_sys(), QSurface::VulkanSurface, VulkanSurface, QPlatformWindow::window(), and WithinCreate.
|
override |
Definition at line 1535 of file qwindowswindow.cpp.
References QWindowsThemeCache::clearThemeCache(), QWindowsWindowData::hwnd, setFlag(), testFlag(), TouchRegistered, and WithinDestroy.
void QWindowsWindow::alertWindow | ( | int | durationMs = 0 | ) |
Definition at line 3206 of file qwindowswindow.cpp.
References QWindowsWindowData::hwnd, and info.
Referenced by setAlertState().
void QWindowsWindow::applyCursor | ( | ) |
Applies to cursor property set on the window to the global cursor.
Definition at line 3151 of file qwindowswindow.cpp.
References applyCursor(), defaultCursor(), QWindowsCursor::enforceOverrideCursor(), CursorHandle::handle(), handle(), QWindowsCursor::hasOverrideCursor(), CursorHandle::isNull(), isTopLevel(), QPlatformWindow::parent(), QPlatformWindow::window(), and windowsWindowOf().
Referenced by applyCursor(), and setCursor().
void QWindowsWindow::checkForScreenChanged | ( | ScreenChangeMode | mode = FromGeometryChange | ) |
Definition at line 2253 of file qwindowswindow.cpp.
References equalDpi(), FromGeometryChange, QWindowsWindowData::hwnd, QWindowsContext::instance(), QPlatformWindow::isForeignWindow(), QWindowsScreenManager::isSingleScreen(), QWindowsBaseWindow::isTopLevel_sys(), QPlatformWindow::parent(), qCDebug, savedDpi(), QPlatformWindow::screen(), updateFullFrameMargins(), and QPlatformWindow::window().
Referenced by handleDpiChanged(), and handleDpiChangedAfterParent().
|
inline |
Definition at line 319 of file qwindowswindow.h.
Referenced by QWindowsWindow(), setAlertState(), setCursor(), setFrameStrutEventsEnabled(), setGeometry(), setHasBorderInFullScreen(), setMouseGrabEnabled(), setStyle(), and windowEvent().
|
inline |
Definition at line 312 of file qwindowswindow.h.
Referenced by applyNewCursor().
|
override |
Returns the margin to be used when handling the WM_NCCALCSIZE
message.
Definition at line 3318 of file qwindowswindow.cpp.
References QWindowsWindowData::customMargins, QWindowsWindowData::flags, and Qt::FramelessWindowHint.
Referenced by handleDpiScaledSize(), and setGeometry().
|
static |
Definition at line 1681 of file qwindowswindow.cpp.
Referenced by qDisplayChangeObserverWndProc().
qreal QWindowsWindow::dpiRelativeScale | ( | const UINT | dpi | ) | const |
Definition at line 1980 of file qwindowswindow.cpp.
References QWindowsScreen::baseDpi, QHighDpiScaling::roundScaleFactor(), and savedDpi().
Referenced by handleDpiChanged(), handleDpiChangedAfterParent(), and handleDpiScaledSize().
Definition at line 1691 of file qwindowswindow.cpp.
References GpuDescription::detect(), nullptr, and screenForDeviceName().
Referenced by calcPosition().
|
overridevirtual |
Returns the actual surface format of the window.
Reimplemented from QPlatformWindow.
Definition at line 1570 of file qwindowswindow.cpp.
References QPlatformWindow::window().
Referenced by QWindowsDirect2DWindow::copyBackBuffer(), and setOpacity().
Definition at line 3469 of file qwindowswindow.cpp.
References QPlatformWindow::formatWindowTitle(), QStringLiteral, and title.
Referenced by QWindowsIntegration::createPlatformWindow(), and setWindowTitle().
|
overridevirtual |
Reimplemented from QWindowsBaseWindow.
Definition at line 2828 of file qwindowswindow.cpp.
References fullFrameMargins(), QWindowsWindowData::hasFrame, QWindowsWindowData::hwnd, invisibleMargins(), and isTopLevel().
Referenced by handleNonClientHitTest(), and setGeometry().
|
inlineoverridevirtual |
Reimplement this method to return whether frame strut events are enabled.
Reimplemented from QPlatformWindow.
Definition at line 266 of file qwindowswindow.h.
References FrameStrutEventsEnabled, and testFlag().
|
overridevirtual |
Reimplemented from QWindowsBaseWindow.
Definition at line 2836 of file qwindowswindow.cpp.
References QWindowsWindowData::flags, QWindowsWindowData::fullFrameMargins, QWindowsWindowData::hwnd, and shouldOmitFrameAdjustment().
Referenced by frameMargins(), getSizeHints(), handleDpiScaledSize(), handleGeometryChanging(), normalGeometry(), setGeometry(), and setMask().
|
inlineoverridevirtual |
Returns the current geometry of a window.
Reimplemented from QWindowsBaseWindow.
Definition at line 220 of file qwindowswindow.h.
References QWindowsWindowData::geometry.
Referenced by QWindowsDirect2DWindow::flush(), handleDpiChangedAfterParent(), handleDpiScaledSize(), and setWindowFlags().
HDC QWindowsWindow::getDC | ( | ) |
Allocates a HDC for the window or returns the temporary one obtained from WinAPI BeginPaint within a WM_PAINT event.
Definition at line 2355 of file qwindowswindow.cpp.
References handle(), QGuiApplication::layoutDirection, and Qt::RightToLeft.
void QWindowsWindow::getSizeHints | ( | MINMAXINFO * | mmi | ) | const |
Definition at line 3069 of file qwindowswindow.cpp.
References QWindowsGeometryHint::applyToMinMaxInfo(), fullFrameMargins(), qCDebug, and QPlatformWindow::window().
Referenced by msgUnableToSetGeometry().
|
inlineoverridevirtual |
Implements QWindowsBaseWindow.
Definition at line 269 of file qwindowswindow.h.
References QWindowsWindowData::hwnd.
Referenced by applyCursor(), getDC(), handleCompositionSettingsChanged(), initialize(), normalGeometry(), QWindowsDirect2DWindow::present(), releaseDC(), setHasBorderInFullScreen(), setHasBorderInFullScreenStatic(), QWindowsDirect2DWindow::setupSwapChain(), QWindowsInputContext::setWindowsImeEnabled(), QWindowsInputContext::showInputPanel(), surface(), and topLevelOf().
void QWindowsWindow::handleCompositionSettingsChanged | ( | ) |
Definition at line 1968 of file qwindowswindow.cpp.
References applyBlurBehindWindow(), QSurface::Direct3DSurface, handle(), QSurface::OpenGLSurface, QSurface::VulkanSurface, and QPlatformWindow::window().
void QWindowsWindow::handleDpiChanged | ( | HWND | hwnd, |
WPARAM | wParam, | ||
LPARAM | lParam ) |
Definition at line 2012 of file qwindowswindow.cpp.
References checkForScreenChanged(), QWindowsThemeCache::clearThemeCache(), dpiRelativeScale(), QWindowsWindowData::flags, FromDpiChange, QWindowsWindowData::hwnd, QWindowsWindowData::restoreGeometry, setMask(), setSavedDpi(), QRect::setSize(), shouldOmitFrameAdjustment(), QRect::size(), QHighDpi::toNativeLocalRegion(), updateFullFrameMargins(), and QPlatformWindow::window().
void QWindowsWindow::handleDpiChangedAfterParent | ( | HWND | hwnd | ) |
Definition at line 2060 of file qwindowswindow.cpp.
References checkForScreenChanged(), dpiRelativeScale(), FromDpiChange, geometry(), setGeometry(), and setSavedDpi().
void QWindowsWindow::handleDpiScaledSize | ( | WPARAM | wParam, |
LPARAM | lParam, | ||
LRESULT * | result ) |
Definition at line 1986 of file qwindowswindow.cpp.
References QWindowsWindowData::customMargins, customMargins(), dpiRelativeScale(), QWindowsWindowData::flags, Qt::FramelessWindowHint, fullFrameMargins(), geometry(), QSize::height(), QRect::size(), SIZE, and QSize::width().
bool QWindowsWindow::handleGeometryChanging | ( | MSG * | message | ) | const |
Definition at line 2759 of file qwindowswindow.cpp.
References fullFrameMargins(), handleGeometryChangingMessage(), and QPlatformWindow::window().
|
static |
Definition at line 2717 of file qwindowswindow.cpp.
References QPlatformWindow::closestAcceptableGeometry(), QWindowsWindowData::embedded, QMargins::left(), Qt::WindowStaysOnBottomHint, and windowsWindowOf().
Referenced by handleGeometryChanging(), and QWindowsContext::windowsProc().
void QWindowsWindow::handleHidden | ( | ) |
Definition at line 1963 of file qwindowswindow.cpp.
void QWindowsWindow::handleMoved | ( | ) |
Definition at line 2178 of file qwindowswindow.cpp.
References QWindowsWindowData::hwnd, testFlag(), and WithinSetParent.
bool QWindowsWindow::handleNonClientHitTest | ( | const QPoint & | globalPos, |
LRESULT * | result ) const |
Definition at line 3075 of file qwindowswindow.cpp.
References QWindowsWindowData::flags, Qt::FramelessWindowHint, frameMargins(), QHighDpi::fromNativePixels(), QSize::height(), QWindowsWindowData::hwnd, invisibleMargins(), isActive(), QSize::isEmpty(), QMargins::top(), QSize::width(), QPlatformWindow::window(), Qt::WindowNoState, QPoint::x(), and QPoint::y().
void QWindowsWindow::handleResized | ( | int | wParam, |
LPARAM | lParam ) |
Definition at line 2185 of file qwindowswindow.cpp.
References Qt::CustomizeWindowHint, QWindowsWindowData::flags, Qt::FramelessWindowHint, QWindowsWindowData::hwnd, invisibleMargins(), MaximizeToFullScreen, qCDebug, testFlag(), Qt::WindowFullScreen, Qt::WindowMaximized, Qt::WindowMinimized, Qt::WindowNoState, Qt::WindowTitleHint, WithinSetGeometry, and WithinSetStyle.
bool QWindowsWindow::handleWmPaint | ( | HWND | hwnd, |
UINT | message, | ||
WPARAM | wParam, | ||
LPARAM | lParam, | ||
LRESULT * | result ) |
Definition at line 2390 of file qwindowswindow.cpp.
References QEventLoop::ExcludeUserInputEvents, QWindowSystemInterface::flushWindowSystemEvents(), QWindowsWindowData::hwnd, QWindowsContext::instance(), isSoftwareGl(), isVisible(), OpenGLSurface, qrectFromRECT(), testFlag(), and QPlatformWindow::window().
|
override |
Returns whether the WS_BORDER flag will be set for the window in full screen mode.
Definition at line 3445 of file qwindowswindow.cpp.
References HasBorderInFullScreen, and testFlag().
Referenced by setHasBorderInFullScreen().
|
inline |
Definition at line 260 of file qwindowswindow.h.
References QWindowsWindowData::hwnd.
Referenced by getWindowUnderPointer(), setMouseGrabEnabled(), setVisible(), and windowEvent().
|
static |
Definition at line 469 of file qwindowswindow.cpp.
References Qt::FramelessWindowHint, and QWindowsBaseWindow::style().
Referenced by setWindowLayered(), and setWindowOpacity().
|
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 1545 of file qwindowswindow.cpp.
References Qt::Desktop, handle(), QWindowsContext::instance(), QWindowCreationContext::obtainedPos, QWindowCreationContext::obtainedSize, QWindowCreationContext::requestedGeometryIn, QPlatformWindow::screen(), screenForGeometry(), setSavedDpi(), setWindowState(), state, QPlatformWindow::window(), Qt::WindowFullScreen, and Qt::WindowMaximized.
|
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 3389 of file qwindowswindow.cpp.
References QWindowsIntegration::staticOpenGLContext(), and QPlatformWindow::window().
|
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 1772 of file qwindowswindow.cpp.
References QWindowsWindowData::hwnd.
Referenced by handleNonClientHitTest().
|
inlineoverridevirtual |
Reimplement this method return whether the window is in an alert state.
Reimplemented from QPlatformWindow.
Definition at line 329 of file qwindowswindow.h.
References AlertState, and testFlag().
Referenced by setAlertState().
|
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 1781 of file qwindowswindow.cpp.
References child, and QWindowsWindowData::hwnd.
|
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 1787 of file qwindowswindow.cpp.
References QWindowsWindowData::embedded.
bool QWindowsWindow::isEnabled | ( | ) | const |
Definition at line 3232 of file qwindowswindow.cpp.
References QWindowsBaseWindow::style().
|
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 227 of file qwindowswindow.h.
References Exposed, and testFlag().
|
inline |
Definition at line 483 of file qwindowswindow.h.
References QWindowsWindowData::hwnd.
Referenced by setVisible(), and setWindowLayered().
|
overridevirtual |
Reimplemented from QWindowsBaseWindow.
Definition at line 3279 of file qwindowswindow.cpp.
References QWindowsWindowData::embedded, and QPlatformWindow::window().
Referenced by QWindowsWindow(), applyCursor(), frameMargins(), setMask(), and setWindowFlags().
bool QWindowsWindow::isVisible | ( | ) | const |
Definition at line 1767 of file qwindowswindow.cpp.
References QWindowsWindowData::hwnd.
Referenced by handleWmPaint(), setGeometry(), and setMouseGrabEnabled().
|
inlineoverridevirtual |
Reimplement to be able to let Qt lower windows to the bottom of the desktop.
Reimplemented from QPlatformWindow.
Definition at line 241 of file qwindowswindow.h.
References QWindowsBaseWindow::lower_sys().
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 1797 of file qwindowswindow.cpp.
References QWindowsWindowData::hwnd, QWindowsGeometryHint::mapFromGlobal(), and pos.
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 1792 of file qwindowswindow.cpp.
References QWindowsWindowData::hwnd, QWindowsGeometryHint::mapToGlobal(), and pos.
QWindowsMenuBar * QWindowsWindow::menuBar | ( | ) | const |
Definition at line 3308 of file qwindowswindow.cpp.
References QPointer< T >::data().
|
overridevirtual |
Returns the geometry of a window in 'normal' state (neither maximized, fullscreen nor minimized) for saving geometries to application settings.
Reimplemented from QPlatformWindow.
Definition at line 2086 of file qwindowswindow.cpp.
References QWindowsGeometryHint::frame(), frame, fullFrameMargins(), handle(), QWindowsWindowData::hwnd, QRect::isValid(), normalFrameGeometry(), QPlatformWindow::window(), and Qt::WindowFullScreen.
|
inline |
Definition at line 255 of file qwindowswindow.h.
Referenced by QWindowsWindow(), QWindowsDirect2DWindow::present(), and setWindowLayered().
|
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 2712 of file qwindowswindow.cpp.
References qCDebug, and QPlatformWindow::window().
|
inlineoverridevirtual |
Reimplement to be able to let Qt raise windows to the top of the desktop.
Reimplemented from QPlatformWindow.
Definition at line 240 of file qwindowswindow.h.
References QWindowsBaseWindow::raise_sys().
void QWindowsWindow::registerTouchWindow | ( | ) |
Definition at line 3408 of file qwindowswindow.cpp.
References QWindowsWindowData::hwnd, QWindowsContext::instance(), QWindowsIntegration::instance(), qErrnoWarning(), qPrintable, setFlag(), QWindowsContext::SI_SupportsTouch, testFlag(), TouchRegistered, QWindowsBaseWindow::touchWindowTouchTypes_sys(), and QPlatformWindow::window().
Referenced by QWindowsWindow().
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.
Definition at line 2372 of file qwindowswindow.cpp.
References handle().
|
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 2903 of file qwindowswindow.cpp.
References Qt::ApplicationActive, QGuiApplication::applicationState(), QWindowsWindowData::flags, QWindowsWindowData::hwnd, QWindowsIntegration::instance(), qCDebug, qCWarning, qScopeGuard(), Qt::ToolTip, QPlatformWindow::window(), Qt::WindowStaysOnBottomHint, and Qt::WindowStaysOnTopHint.
|
inline |
Definition at line 222 of file qwindowswindow.h.
References QWindowsWindowData::restoreGeometry.
|
inline |
Definition at line 347 of file qwindowswindow.h.
Referenced by checkForScreenChanged(), and dpiRelativeScale().
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().
Definition at line 134 of file qplatformwindow.cpp.
Referenced by initialize().
|
overridevirtual |
Reimplement this method to set whether the window demands attention (for example, by flashing the taskbar icon) depending on enabled.
Reimplemented from QPlatformWindow.
Definition at line 3193 of file qwindowswindow.cpp.
References AlertState, alertWindow(), clearFlag(), isAlertState(), setFlag(), and stopAlertWindow().
void QWindowsWindow::setCursor | ( | const CursorHandlePtr & | c | ) |
Definition at line 3172 of file qwindowswindow.cpp.
References applyCursor(), applyNewCursor(), clearFlag(), CursorHandle::handle(), qCDebug, RestoreOverrideCursor, testFlag(), and QPlatformWindow::window().
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 3335 of file qwindowswindow.cpp.
References QWindowsWindowData::customMargins, QWindowsWindowData::flags, QWindowsBaseWindow::frameGeometry_sys(), Qt::FramelessWindowHint, QRect::height(), QWindowsWindowData::hwnd, QRect::marginsRemoved(), QRect::moveTo(), qCDebug, qCWarning, QRect::width(), QRect::x(), and QRect::y().
void QWindowsWindow::setDarkBorder | ( | bool | d | ) |
Definition at line 3300 of file qwindowswindow.cpp.
References d, QWindowsWindowData::hwnd, setDarkBorderToWindow(), shouldApplyDarkFrame(), and QPlatformWindow::window().
Referenced by windowEvent().
|
static |
Definition at line 3289 of file qwindowswindow.cpp.
References d, DwmwaUseImmersiveDarkMode, DwmwaUseImmersiveDarkModeBefore20h1, ok, and qCWarning.
Referenced by WindowCreationData::create(), and setDarkBorder().
void QWindowsWindow::setEnabled | ( | bool | enabled | ) |
Definition at line 3237 of file qwindowswindow.cpp.
References setStyle(), and QWindowsBaseWindow::style().
Referenced by windowEvent().
void QWindowsWindow::setExStyle | ( | unsigned | s | ) | const |
Definition at line 2683 of file qwindowswindow.cpp.
References debugWinExStyle(), QWindowsWindowData::hwnd, qCDebug, and QPlatformWindow::window().
|
inline |
Definition at line 318 of file qwindowswindow.h.
Referenced by QWindowsWindow(), ~QWindowsWindow(), registerTouchWindow(), setAlertState(), setFrameStrutEventsEnabled(), setGeometry(), setHasBorderInFullScreen(), setStyle(), startSystemResize(), and windowEvent().
|
overridevirtual |
Reimplement this method to set whether frame strut events should be sent to enabled.
Reimplemented from QPlatformWindow.
Definition at line 3060 of file qwindowswindow.cpp.
References clearFlag(), FrameStrutEventsEnabled, and setFlag().
Definition at line 2765 of file qwindowswindow.cpp.
References QWindowsWindowData::flags, QWindowsWindowData::fullFrameMargins, QWindowsWindowData::hwnd, qCDebug, shouldOmitFrameAdjustment(), and QPlatformWindow::window().
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 2143 of file qwindowswindow.cpp.
References clearFlag(), customMargins(), frameMargins(), fullFrameMargins(), QWindowsWindowData::geometry, QWindowsWindowData::hwnd, QLibraryInfo::isDebugBuild(), isVisible(), QMargins::left(), msgUnableToSetGeometry(), QWindowsGeometryHint::positionIncludesFrame(), qPrintable, qWarning, rect, setFlag(), QPlatformWindow::setGeometry(), QWindowsBaseWindow::setGeometry_sys(), setWindowState(), QMargins::top(), warning(), QPlatformWindow::window(), Qt::WindowMinimized, Qt::WindowNoState, and WithinSetGeometry.
Referenced by handleDpiChangedAfterParent().
|
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 3450 of file qwindowswindow.cpp.
References clearFlag(), handle(), HasBorderInFullScreen, hasBorderInFullScreen(), setFlag(), QWindowsBaseWindow::style(), and Qt::WindowFullScreen.
Referenced by setHasBorderInFullScreenStatic().
|
static |
Definition at line 3440 of file qwindowswindow.cpp.
Referenced by QWindowsApplication::setHasBorderInFullScreenDefault().
Definition at line 3432 of file qwindowswindow.cpp.
References handle(), hasBorderInFullScreenProperty, setHasBorderInFullScreen(), QObject::setProperty(), and QPlatformWindow::window().
|
overridevirtual |
Reimplemented from QPlatformWindow.
Definition at line 2977 of file qwindowswindow.cpp.
References context, QWindowsWindowData::hwnd, QWindowsContext::instance(), qCDebug, qWarning, and QPlatformWindow::window().
Reimplement to be able to let Qt set the mask of a window.
Reimplemented from QPlatformWindow.
Definition at line 2884 of file qwindowswindow.cpp.
References fullFrameMargins(), QWindowsWindowData::hwnd, QRegion::isEmpty(), isTopLevel(), QMargins::left(), qRegionToWinRegion(), QMargins::top(), and QPlatformWindow::window().
Referenced by QWindowsWindow(), and handleDpiChanged().
void QWindowsWindow::setMenuBar | ( | QWindowsMenuBar * | mb | ) |
Definition at line 3313 of file qwindowswindow.cpp.
|
overridevirtual |
Reimplemented from QPlatformWindow.
Definition at line 2995 of file qwindowswindow.cpp.
References AutoMouseCapture, className, clearFlag(), hasMouseCapture(), QWindowsWindowData::hwnd, isVisible(), metaObject(), qCDebug, qPrintable, qWarning, and QPlatformWindow::window().
Referenced by setVisible().
Reimplement to be able to let Qt set the opacity level of a window.
Reimplemented from QPlatformWindow.
Definition at line 2843 of file qwindowswindow.cpp.
References Direct3DSurface, QWindowsWindowData::flags, format(), hasAlpha(), QWindowsWindowData::hwnd, OpenGLSurface, qCDebug, qFuzzyCompare(), setWindowOpacity(), testFlag(), VulkanSurface, and QPlatformWindow::window().
Referenced by QWindowsWindow().
|
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 1918 of file qwindowswindow.cpp.
References QWindowsWindowData::hwnd, qCDebug, and QPlatformWindow::window().
|
inline |
Definition at line 346 of file qwindowswindow.h.
Referenced by handleDpiChanged(), handleDpiChangedAfterParent(), and initialize().
void QWindowsWindow::setStyle | ( | unsigned | s | ) | const |
Definition at line 2675 of file qwindowswindow.cpp.
References clearFlag(), debugWinStyle(), QWindowsWindowData::hwnd, qCDebug, setFlag(), QPlatformWindow::window(), and WithinSetStyle.
Referenced by setEnabled().
|
static |
Definition at line 1686 of file qwindowswindow.cpp.
Referenced by QWindowsContext::windowsProc().
Definition at line 466 of file qwindowswindow.h.
|
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 1737 of file qwindowswindow.cpp.
References QGuiApplication::focusWindow(), hasMouseCapture(), QWindowsBaseWindow::hide_sys(), QWindowsWindowData::hwnd, isLayered(), QObject::parent(), Qt::Popup, qCDebug, setMouseGrabEnabled(), win, and QPlatformWindow::window().
|
overridevirtual |
Requests setting the window flags of this surface to flags.
Reimplemented from QPlatformWindow.
Definition at line 2428 of file qwindowswindow.cpp.
References QWindowsWindowData::flags, geometry(), QWindowsBaseWindow::geometry_sys(), QWindowsWindowData::hwnd, isTopLevel(), qCDebug, and QPlatformWindow::window().
Referenced by QWindowsDirect2DWindow::setWindowFlags().
Reimplement to set the window icon to icon.
Reimplemented from QPlatformWindow.
Definition at line 3261 of file qwindowswindow.cpp.
References createHIcon(), QWindowsWindowData::hwnd, and icon.
Referenced by QWindowsWindow().
|
static |
Definition at line 478 of file qwindowswindow.cpp.
References QWindowsBaseWindow::exStyle(), hasAlpha(), hasNoNativeFrame(), isLayered(), opacity(), and Qt::WindowTransparentForInput.
Referenced by QWindowsBackingStore::flush(), and setWindowOpacity().
|
overridevirtual |
Requests setting the window state of this surface to type.
Qt::WindowActive can be ignored.
Reimplemented from QPlatformWindow.
Definition at line 2514 of file qwindowswindow.cpp.
References QWindowsWindowData::hwnd, and state.
Referenced by initialize(), and setGeometry().
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.
Reimplemented from QPlatformWindow.
Definition at line 2423 of file qwindowswindow.cpp.
References formatWindowTitle(), QWindowsBaseWindow::setWindowTitle_sys(), and title.
|
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.
Reimplemented from QPlatformWindow.
Definition at line 3053 of file qwindowswindow.cpp.
References QWindowsWindowData::hwnd.
|
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.
Reimplemented from QPlatformWindow.
Definition at line 3042 of file qwindowswindow.cpp.
References edgesToWinOrientation(), QWindowsWindowData::hwnd, Qt::MSWindowsFixedSizeDialogHint, Q_UNLIKELY, setFlag(), SizeGripOperation, testFlag(), and QPlatformWindow::window().
void QWindowsWindow::stopAlertWindow | ( | ) |
Definition at line 3221 of file qwindowswindow.cpp.
References QWindowsWindowData::hwnd, and info.
Referenced by setAlertState().
Definition at line 3355 of file qwindowswindow.cpp.
References handle(), QWindowsWindowData::hwnd, Q_UNUSED, qWarning, QWindowsIntegration::staticOpenGLContext(), QSurface::VulkanSurface, and QPlatformWindow::window().
|
inline |
Definition at line 317 of file qwindowswindow.h.
Referenced by ~QWindowsWindow(), frameStrutEventsEnabled(), handleMoved(), handleResized(), handleWmPaint(), hasBorderInFullScreen(), isAlertState(), isExposed(), registerTouchWindow(), setCursor(), setOpacity(), and startSystemResize().
Definition at line 1703 of file qwindowswindow.cpp.
References handle(), QWindowsContext::instance(), QPlatformWindow::parent(), and topLevelOf().
Referenced by isValidWheelReceiver(), isValidWheelReceiver(), showSystemMenu(), QWindowsScreen::topLevelAt(), and topLevelOf().
void QWindowsWindow::updateFullFrameMargins | ( | ) |
Definition at line 2775 of file qwindowswindow.cpp.
References QWindowsContext::forceNcCalcSize(), and QWindowsWindowData::hwnd.
Referenced by checkForScreenChanged(), and handleDpiChanged().
void QWindowsWindow::updateRestoreGeometry | ( | ) |
Definition at line 2509 of file qwindowswindow.cpp.
References QWindowsWindowData::hwnd, normalFrameGeometry(), and QWindowsWindowData::restoreGeometry.
|
inlinestatic |
Definition at line 461 of file qwindowswindow.h.
|
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 QPlatformWindow.
Definition at line 2689 of file qwindowswindow.cpp.
References QEvent::ApplicationPaletteChange, BlockedByModal, clearFlag(), Qt::Dark, hasMouseCapture(), QWindowsTheme::instance(), setDarkBorder(), setEnabled(), setFlag(), QEvent::WindowBlocked, QPlatformWindow::windowEvent(), and QEvent::WindowUnblocked.
|
inlinestatic |
Definition at line 449 of file qwindowswindow.h.
References Qt::Desktop.
Referenced by applyCursor(), applyNewCursor(), QWindowsCursor::changeCursor(), QWindowsBackingStore::flush(), handleGeometryChangingMessage(), QWindowsInputContext::isInputPanelVisible(), isValidWheelReceiver(), isValidWheelReceiver(), qWindowsPowerWindowProc(), QWindowsInputContext::showInputPanel(), QWindowsMouseHandler::translateMouseEvent(), and QWindowsContext::windowsProc().
|
static |
Definition at line 343 of file qwindowswindow.h.
Referenced by WindowCreationData::fromWindow(), and QWindowsContext::shouldHaveNonClientDpiScaling().
|
static |
Definition at line 344 of file qwindowswindow.h.
Referenced by QWindowsWindow(), and setHasBorderInFullScreenStatic().