QtBase
v6.3.1
|
#include <qplatformwindow.h>
Static Public Member Functions | |
static QRect | initialGeometry (const QWindow *w, const QRect &initialGeometry, int defaultWidth, int defaultHeight, const QScreen **resultingScreenReturn=nullptr) |
static QRectF | closestAcceptableGeometry (const QWindow *w, const QRectF &nativeRect) |
Static Public Member Functions inherited from QPlatformSurface | |
static bool | isRasterSurface (QSurface *surface) |
Protected Member Functions | |
QPlatformScreen * | screenForGeometry (const QRect &newGeometry) const |
Static Protected Member Functions | |
static QString | formatWindowTitle (const QString &title, const QString &separator) |
static QSize | constrainWindowSize (const QSize &size) |
Protected Attributes | |
QScopedPointer< QPlatformWindowPrivate > | d_ptr |
Definition at line 72 of file qplatformwindow.h.
|
explicit |
Constructs a platform window with the given top level window.
Definition at line 58 of file qplatformwindow.cpp.
|
override |
Virtual destructor does not delete its top level window.
Definition at line 69 of file qplatformwindow.cpp.
|
virtual |
Reimplement to let the platform handle non-spontaneous window close.
When reimplementing make sure to call the base class implementation or QWindowSystemInterface::handleCloseEvent(), which will prompt the user to accept the window close (if needed) and then close the QWindow.
Definition at line 363 of file qplatformwindow.cpp.
|
static |
Returns the closest acceptable geometry for a given geometry before a resize/move event for platforms that support it, for example to implement heightForWidth().
Definition at line 876 of file qplatformwindow.cpp.
Returns a size with both dimensions bounded to [0, QWINDOWSIZE_MAX]
Definition at line 609 of file qplatformwindow.cpp.
|
virtual |
Delivers an QEvent::UpdateRequest event to the window.
QPlatformWindow subclasses can re-implement this function to provide e.g. logging or tracing of the delivery, but should always call the base class function.
Reimplemented in QCocoaWindow.
Definition at line 802 of file qplatformwindow.cpp.
|
virtual |
Reimplement this function in subclass to return the device pixel ratio for the window. This is the ratio between physical pixels and device-independent pixels.
Reimplemented in QWasmWindow, QIOSWindow, and QCocoaWindow.
Definition at line 444 of file qplatformwindow.cpp.
|
overridevirtual |
Returns the actual surface format of the window.
Implements QPlatformSurface.
Reimplemented in QXcbWindow, QWindowsWindow, QQnxEglWindow, QIOSWindow, QEglFSWindow, QCocoaWindow, QAndroidPlatformVulkanWindow, QAndroidPlatformOpenGLWindow, and QDirectFbWindowEGL.
Definition at line 113 of file qplatformwindow.cpp.
|
staticprotected |
Call this method to put together a window title composed of title separator the application display name
If the display name isn't set, and the title is empty, the raw app name is used.
Definition at line 557 of file qplatformwindow.cpp.
|
virtual |
Reimplemented in QXcbWindow, QWindowsWindow, QWindowsDesktopWindow, QWindowsBaseWindow, QWasmWindow, QOffscreenWindow, QHaikuWindow, and QCocoaWindow.
Definition at line 163 of file qplatformwindow.cpp.
|
virtual |
Reimplement this method to return whether frame strut events are enabled.
Reimplemented in QWindowsWindow, and QCocoaWindow.
Definition at line 544 of file qplatformwindow.cpp.
|
virtual |
Returns the current geometry of a window
Reimplemented in QWindowsWindow, QWindowsBaseWindow, QEglFSWindow, and QCocoaWindow.
Definition at line 145 of file qplatformwindow.cpp.
|
virtual |
Handle changes to the orientation of the platform window's contents.
This is a hint to the window manager in case it needs to display additional content like popups, dialogs, status bars, or similar in relation to the window.
Reimplemented in QIOSWindow.
Definition at line 432 of file qplatformwindow.cpp.
bool QPlatformWindow::hasPendingUpdateRequest | ( | ) | const |
Returns true if the window has a pending update request.
Definition at line 790 of file qplatformwindow.cpp.
|
static |
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. its parent. For example this is useful on Windows and MacOS but not X11, because an X11 window manager typically tries to layout new windows to optimize usage of the available desktop space. However if the given window already has geometry which the application has initialized, it takes priority.
initialGeometry has to be provided in native pixels. defaultWidth has to be provided in device independent pixels defaultHeight has to be provided in device independent pixels
Definition at line 708 of file qplatformwindow.cpp.
|
virtual |
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 in QWindowsWindow, QWasmWindow, and QCocoaWindow.
Definition at line 80 of file qplatformwindow.cpp.
|
virtual |
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 in QWindowsWindow, QEglFSKmsVsp2Window, QEglFSKmsEglDeviceWindow, QEglFSKmsGbmWindow, and QEglFSWindow.
Definition at line 677 of file qplatformwindow.cpp.
|
virtual |
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 in QWindowsWindow, and QHaikuWindow.
Definition at line 218 of file qplatformwindow.cpp.
|
virtual |
Reimplement this method return whether the window is in an alert state.
Reimplemented in QXcbWindow, QWindowsWindow, and QCocoaWindow.
Definition at line 635 of file qplatformwindow.cpp.
|
virtual |
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 in QWindowsWindow.
Definition at line 230 of file qplatformwindow.cpp.
|
virtual |
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 in QXcbWindow, QWindowsWindow, and QCocoaWindow.
Definition at line 246 of file qplatformwindow.cpp.
|
virtual |
Returns if this window is exposed in the windowing system.
An exposeEvent() is sent every time this value changes.
Reimplemented in QXcbWindow, QWindowsWindow, QQnxWindow, QIOSWindow, QHaikuWindow, QCocoaWindow, and QAndroidPlatformWindow.
Definition at line 207 of file qplatformwindow.cpp.
|
inlinevirtual |
Reimplemented in QXcbForeignWindow, QWindowsForeignWindow, QQnxForeignWindow, QCocoaWindow, and QAndroidPlatformForeignWindow.
Definition at line 115 of file qplatformwindow.h.
|
virtual |
Reimplement to be able to let Qt lower windows to the bottom of the desktop
Reimplemented in QXcbWindow, QWindowsWindow, QWindowsForeignWindow, QWasmWindow, QQnxWindow, QIOSWindow, QEglFSWindow, QCocoaWindow, QAndroidPlatformWindow, QAndroidPlatformForeignWindow, QFbWindow, and QDirectFbWindow.
Definition at line 376 of file qplatformwindow.cpp.
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 in QXcbWindow, QWindowsWindow, and QWindowsBaseWindow.
Definition at line 290 of file qplatformwindow.cpp.
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 in QXcbWindow, QWindowsWindow, and QWindowsBaseWindow.
Definition at line 258 of file qplatformwindow.cpp.
|
virtual |
Returns the geometry of a window in 'normal' state (neither maximized, fullscreen nor minimized) for saving geometries to application settings.
Reimplemented in QWindowsWindow, QWasmWindow, and QCocoaWindow.
Definition at line 158 of file qplatformwindow.cpp.
QPlatformWindow * QPlatformWindow::parent | ( | ) | const |
Returns the parent platform window (or \nullptr if orphan).
Definition at line 95 of file qplatformwindow.cpp.
|
virtual |
Reimplement to propagate the size hints of the QWindow.
The size hints include QWindow::minimumSize(), QWindow::maximumSize(), QWindow::sizeIncrement(), and QWindow::baseSize().
Reimplemented in QXcbWindow, QWindowsWindow, QWasmWindow, QQnxWindow, QIOSWindow, QHaikuWindow, QEglFSWindow, QCocoaWindow, QAndroidPlatformWindow, and QFbWindow.
Definition at line 384 of file qplatformwindow.cpp.
|
virtual |
Reimplement to be able to let Qt raise windows to the top of the desktop
Reimplemented in QXcbWindow, QWindowsWindow, QWindowsForeignWindow, QWasmWindow, QQnxWindow, QIOSWindow, QEglFSWindow, QCocoaWindow, QAndroidPlatformWindow, QAndroidPlatformForeignWindow, QFbWindow, and QDirectFbWindow.
Definition at line 371 of file qplatformwindow.cpp.
|
virtual |
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::handleWindowActivated(QWindow *w) would be sufficient.
If the window system has some event handling/callbacks then call QWindowSystemInterface::handleWindowActivated(QWindow *w) when the window system gives the notification.
Default implementation calls QWindowSystem::handleWindowActivated(QWindow *w)
Reimplemented in QXcbWindow, QWindowsWindow, QWasmWindow, QQnxWindow, QOffscreenWindow, QIOSWindow, QHaikuWindow, QEglFSWindow, QCocoaWindow, and QAndroidPlatformWindow.
Definition at line 418 of file qplatformwindow.cpp.
|
virtual |
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 5 ms. The additional time is there to give the event loop a bit of idle time to gather system events.
Reimplemented in QWasmWindow, QIOSWindow, and QCocoaWindow.
Definition at line 771 of file qplatformwindow.cpp.
|
virtual |
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 in QIOSWindow, and QAndroidPlatformWindow.
Definition at line 173 of file qplatformwindow.cpp.
|
overridevirtual |
Returns the platform screen handle corresponding to this platform window, or null if the window is not associated with a screen.
Implements QPlatformSurface.
Reimplemented in QQnxWindow, and QEglFSWindow.
Definition at line 104 of file qplatformwindow.cpp.
|
protected |
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 583 of file qplatformwindow.cpp.
|
virtual |
Reimplement this method to set whether the window demands attention (for example, by flashing the taskbar icon) depending on enabled.
Reimplemented in QXcbWindow, QWindowsWindow, and QCocoaWindow.
Definition at line 622 of file qplatformwindow.cpp.
|
virtual |
Reimplement this method to set whether frame strut events should be sent to enabled.
Reimplemented in QWindowsWindow, and QCocoaWindow.
Definition at line 534 of file qplatformwindow.cpp.
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 in QXcbWindow, QWindowsWindow, QWindowsForeignWindow, QQnxWindow, QQnxEglWindow, QOffscreenWindow, QIOSWindow, QHaikuWindow, QCocoaWindow, QAndroidPlatformWindow, QAndroidPlatformVulkanWindow, QAndroidPlatformOpenGLWindow, QAndroidPlatformForeignWindow, QFbWindow, QDirectFbWindow, QVkKhrDisplayWindow, QWasmWindow, QMinimalEglWindow, and QEglFSWindow.
Definition at line 136 of file qplatformwindow.cpp.
|
virtual |
Reimplemented in QWasmWindow, QEglFSWindow, QFbWindow, QXcbWindow, QWindowsWindow, QIOSWindow, QCocoaWindow, QAndroidPlatformWindow, and QDirectFbWindow.
Definition at line 449 of file qplatformwindow.cpp.
Reimplement to be able to let Qt set the mask of a window
Reimplemented in QXcbWindow, QWindowsWindow, QCocoaWindow, and QEglFSWindow.
Definition at line 399 of file qplatformwindow.cpp.
|
virtual |
Reimplemented in QWasmWindow, QEglFSWindow, QFbWindow, QXcbWindow, QWindowsWindow, QIOSWindow, QCocoaWindow, QAndroidPlatformWindow, and QDirectFbWindow.
Definition at line 456 of file qplatformwindow.cpp.
Reimplement to be able to let Qt set the opacity level of a window
Reimplemented in QEglFSWindow, QXcbWindow, QWindowsWindow, QQnxWindow, QIOSWindow, QCocoaWindow, and QDirectFbWindow.
Definition at line 389 of file qplatformwindow.cpp.
|
virtual |
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 in QXcbWindow, QWindowsWindow, QWindowsForeignWindow, QQnxWindow, QQnxRasterWindow, QIOSWindow, QCocoaWindow, QAndroidPlatformWindow, and QAndroidPlatformForeignWindow.
Definition at line 330 of file qplatformwindow.cpp.
|
virtual |
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 in QXcbWindow, QWindowsWindow, QWindowsForeignWindow, QWasmWindow, QQnxWindow, QOffscreenWindow, QIOSWindow, QHaikuWindow, QEglFSWindow, QCocoaWindow, QAndroidPlatformWindow, QAndroidPlatformForeignWindow, QFbWindow, and QDirectFbWindow.
Definition at line 184 of file qplatformwindow.cpp.
Reimplement to set the window file path to filePath
Reimplemented in QCocoaWindow.
Definition at line 349 of file qplatformwindow.cpp.
|
virtual |
Requests setting the window flags of this surface to flags.
Reimplemented in QFbWindow, QXcbWindow, QWindowsWindow, QHaikuWindow, QWindowsDirect2DWindow, QCocoaWindow, QAndroidPlatformWindow, and QDirectFbWindow.
Definition at line 196 of file qplatformwindow.cpp.
Reimplement to set the window icon to icon
Reimplemented in QXcbWindow, QWindowsWindow, and QCocoaWindow.
Definition at line 354 of file qplatformwindow.cpp.
|
virtual |
Reimplement to be able to let Qt indicate that the window has been modified. Return true if the native window supports setting the modified flag, false otherwise.
Reimplemented in QCocoaWindow.
Definition at line 468 of file qplatformwindow.cpp.
|
virtual |
Requests setting the window state of this surface to type.
Qt::WindowActive can be ignored.
Reimplemented in QOffscreenWindow, QXcbWindow, QWindowsWindow, QWasmWindow, QQnxWindow, QIOSWindow, QHaikuWindow, QCocoaWindow, QAndroidPlatformWindow, and QFbWindow.
Definition at line 307 of file qplatformwindow.cpp.
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 in QXcbWindow, QWindowsWindow, QWindowsForeignWindow, QHaikuWindow, and QCocoaWindow.
Definition at line 344 of file qplatformwindow.cpp.
|
virtual |
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 in QXcbWindow, QWindowsWindow, and QCocoaWindow.
Definition at line 522 of file qplatformwindow.cpp.
|
virtual |
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 in QXcbWindow, and QWindowsWindow.
Definition at line 507 of file qplatformwindow.cpp.
QWindow * QPlatformWindow::window | ( | ) | const |
Returns the window which belongs to the QPlatformWindow
Definition at line 87 of file qplatformwindow.cpp.
QSize QPlatformWindow::windowBaseSize | ( | ) | const |
Returns the QWindow base size.
Definition at line 832 of file qplatformwindow.cpp.
|
virtual |
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 in QXcbWindow, and QWindowsWindow.
Definition at line 483 of file qplatformwindow.cpp.
QRect QPlatformWindow::windowFrameGeometry | ( | ) | const |
Returns the QWindow frame geometry.
Definition at line 865 of file qplatformwindow.cpp.
QRect QPlatformWindow::windowGeometry | ( | ) | const |
Returns the QWindow geometry.
Definition at line 857 of file qplatformwindow.cpp.
QSize QPlatformWindow::windowMaximumSize | ( | ) | const |
Returns the QWindow maximum size.
Definition at line 824 of file qplatformwindow.cpp.
QSize QPlatformWindow::windowMinimumSize | ( | ) | const |
Returns the QWindow minimum size.
Definition at line 816 of file qplatformwindow.cpp.
QSize QPlatformWindow::windowSizeIncrement | ( | ) | const |
Returns the QWindow size increment.
Definition at line 840 of file qplatformwindow.cpp.
|
virtual |
Reimplement in subclasses to return a handle to the native window
Reimplemented in QXcbWindow, QWindowsBaseWindow, QWasmWindow, QQnxWindow, QOffscreenWindow, QMinimalEglWindow, QIOSWindow, QHaikuWindow, QEglFSWindow, QCocoaWindow, QAndroidPlatformWindow, QFbWindow, and QDirectFbWindow.
Definition at line 314 of file qplatformwindow.cpp.
|
protected |
Definition at line 173 of file qplatformwindow.h.