Qt 4.8
|
The QPlatformWindow class provides an abstraction for top-level windows. More...
#include <qplatformwindow_qpa.h>
Public Functions | |
virtual QRect | geometry () const |
Returnes the current geometry of a window. More... | |
virtual QPlatformGLContext * | glContext () const |
Reimplement to return the glContext associated with the window. More... | |
virtual void | lower () |
Reimplement to be able to let Qt lower windows to the bottom of the desktop. More... | |
QPlatformWindow (QWidget *tlw) | |
Constructs a platform window with the given top level widget. More... | |
virtual void | raise () |
Reimplement to be able to let Qt rais windows to the top of the desktop. More... | |
virtual void | requestActivateWindow () |
Reimplement to let Qt be able to request activation/focus for a window. More... | |
virtual void | setGeometry (const QRect &rect) |
This function is called by Qt whenever a window is moved or the window is resized. More... | |
virtual void | setOpacity (qreal level) |
Reimplement to be able to let Qt set the opacity level of a window. More... | |
virtual void | setParent (const QPlatformWindow *window) |
This function is called to enable native child widgets in QPA. More... | |
virtual void | setVisible (bool visible) |
Reimplemented in subclasses to show the surface if visible is true , and hide it if visible is false . More... | |
virtual Qt::WindowFlags | setWindowFlags (Qt::WindowFlags flags) |
Requests setting the window flags of this surface to type. More... | |
virtual void | setWindowTitle (const QString &title) |
Reimplement to set the window title to title. More... | |
QWidget * | widget () const |
Returnes the widget which belongs to the QPlatformWindow. More... | |
virtual Qt::WindowFlags | windowFlags () const |
Returns the effective window flags for this surface. More... | |
virtual WId | winId () const |
Reimplement in subclasses to return a handle to the native window. More... | |
virtual | ~QPlatformWindow () |
Virtual destructor does not delete its top level widget. More... | |
Protected Variables | |
QScopedPointer< QPlatformWindowPrivate > | d_ptr |
The QPlatformWindow class provides an abstraction for top-level windows.
The QPlatformWindow abstraction is used by QWidget for all its top level widgets. It is being created by calling the createPlatformWindow function in the loaded QPlatformIntegration instance.
QPlatformWindow is used to signal to the windowing system, how Qt persieves its frame. However, it is not concerned with how Qt renders into the window it represents.
Top level QWidgets(tlw) will always have a QPlatformWindow. However, it is not necessary for all tlw to have a QWindowSurface. This is the case for QGLWidget. And could be the case for widgets where some 3.party renders into it.
The platform specific window handle can be retrieved by the winId function.
QPlatformWindow is also the way QPA defines how native child windows should be supported through the setParent function.
The only way to retrieve a QPlatformGLContext in QPA is by calling the glContext() function on QPlatformWindow.
Definition at line 61 of file qplatformwindow_qpa.h.
QPlatformWindow::QPlatformWindow | ( | QWidget * | tlw | ) |
Constructs a platform window with the given top level widget.
Definition at line 59 of file qplatformwindow_qpa.cpp.
|
virtual |
Virtual destructor does not delete its top level widget.
Definition at line 70 of file qplatformwindow_qpa.cpp.
|
virtual |
Returnes the current geometry of a window.
Definition at line 98 of file qplatformwindow_qpa.cpp.
Referenced by QFbScreen::addWindow(), QWaylandWindow::configure(), QXlibWindow::doSizeHints(), QFbScreen::generateRects(), QWaylandReadbackGlxContext::geometryChanged(), QWaylandXCompositeEGLContext::geometryChanged(), QWaylandReadbackEglContext::geometryChanged(), QWaylandXCompositeGLXContext::geometryChanged(), QXcbWindow::handleConfigureNotifyEvent(), QFbScreen::lower(), QWaylandEglWindow::newSurfaceCreated(), QBBWindow::offset(), QXlibWindow::paintEvent(), QFbScreen::raise(), QFbScreen::removeWindow(), QXlibWindow::resizeEvent(), QBBScreen::resizeNativeWidgetWindow(), QBBScreen::resizeTopLevelWindow(), QDirectFbWindow::setGeometry(), QOpenKODEWindow::setGeometry(), QBBWindow::setGeometry(), QXcbWindow::setParent(), QXlibWindow::setParent(), QDirectFbWindow::setVisible(), QWaylandReadbackGlxContext::swapBuffers(), QWaylandReadbackEglContext::swapBuffers(), QWaylandXCompositeEGLContext::swapBuffers(), QWaylandXCompositeGLXContext::swapBuffers(), and QBBGLContext::swapBuffers().
|
virtual |
Reimplement to return the glContext associated with the window.
Reimplemented in QUIKitWindow, QXlibWindow, QBBWindow, QXcbWindow, QOpenKODEWindow, QEglFSWindow, QWaylandEglWindow, QWaylandReadbackEglWindow, QWaylandReadbackGlxWindow, QWaylandXCompositeEGLWindow, QWaylandXCompositeGLXWindow, and QWaylandShmWindow.
Definition at line 195 of file qplatformwindow_qpa.cpp.
Referenced by QWaylandGLWindowSurface::flush().
|
virtual |
Reimplement to be able to let Qt lower windows to the bottom of the desktop.
Reimplemented in QFbWindow, QXlibWindow, QBBWindow, QXcbWindow, QOpenKODEWindow, and QDirectFbWindow.
Definition at line 163 of file qplatformwindow_qpa.cpp.
|
virtual |
Reimplement to be able to let Qt rais windows to the top of the desktop.
Reimplemented in QFbWindow, QXlibWindow, QBBWindow, QXcbWindow, QOpenKODEWindow, and QDirectFbWindow.
Definition at line 158 of file qplatformwindow_qpa.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(QWidget *w) would be sufficient.
If the window system has some event handling/callbacks then call QWindowSystemInterface::handleWindowActivated(QWidget *w) when the window system gives the notification.
Default implementation calls QWindowSystem::handleWindowActivated(QWidget *w)
Reimplemented in QXlibWindow, QBBWindow, and QXcbWindow.
Definition at line 187 of file qplatformwindow_qpa.cpp.
|
virtual |
This function is called by Qt whenever a window is moved or the window is resized.
The resize can happen programatically(from ie. user application) or by the window manager. This means that there is no need to call this function specifically from the window manager callback, instead call QWindowSystemInterface::handleGeometryChange(QWidget *w, const QRect &newRect);
Reimplemented in QFbWindow, QUIKitWindow, QXlibWindow, QVFbWindow, QBBWindow, QOpenKODEWindow, QXcbWindow, QWaylandReadbackEglWindow, QDirectFbWindow, QEglFSWindow, QCocoaWindow, QWaylandReadbackGlxWindow, QWaylandEglWindow, QWaylandXCompositeEGLWindow, and QWaylandXCompositeGLXWindow.
Definition at line 89 of file qplatformwindow_qpa.cpp.
Referenced by QWaylandWindow::configure(), QXcbWindow::handleConfigureNotifyEvent(), QBBWindow::offset(), QWaylandReadbackGlxWindow::setGeometry(), QWaylandEglWindow::setGeometry(), QWaylandXCompositeEGLWindow::setGeometry(), QWaylandXCompositeGLXWindow::setGeometry(), QCocoaWindow::setGeometry(), QEglFSWindow::setGeometry(), QDirectFbWindow::setGeometry(), QWaylandReadbackEglWindow::setGeometry(), QXcbWindow::setGeometry(), QBBWindow::setGeometry(), QVFbWindow::setGeometry(), QXlibWindow::setGeometry(), QUIKitWindow::setGeometry(), and QFbWindow::setGeometry().
|
virtual |
Reimplement to be able to let Qt set the opacity level of a window.
Reimplemented in QBBWindow, and QDirectFbWindow.
Definition at line 168 of file qplatformwindow_qpa.cpp.
|
virtual |
This function is called to enable native child widgets 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 QXlibWindow, QBBWindow, QWaylandWindow, QXcbWindow, and QWaylandEglWindow.
Definition at line 144 of file qplatformwindow_qpa.cpp.
Referenced by q_createNativeChildrenAndSetParent().
|
virtual |
Reimplemented in subclasses to show the surface if visible is true
, and hide it if visible is false
.
Reimplemented in QFbWindow, QXlibWindow, QBBWindow, QWaylandWindow, QXcbWindow, QOpenKODEWindow, QDirectFbWindow, and QCocoaWindow.
Definition at line 108 of file qplatformwindow_qpa.cpp.
|
virtual |
Requests setting the window flags of this surface to type.
Returns the actual flags set.
Reimplemented in QFbWindow, QXlibWindow, QXcbWindow, and QDirectFbWindow.
Definition at line 116 of file qplatformwindow_qpa.cpp.
Referenced by QXcbWindow::setWindowFlags().
|
virtual |
Reimplement to set the window title to title.
Reimplemented in QXlibWindow, and QXcbWindow.
Definition at line 153 of file qplatformwindow_qpa.cpp.
QWidget * QPlatformWindow::widget | ( | ) | const |
Returnes the widget which belongs to the QPlatformWindow.
Definition at line 77 of file qplatformwindow_qpa.cpp.
Referenced by QBBScreen::addWindow(), QBBWindow::buffer(), QWaylandWindow::configure(), QBBGLContext::createSurface(), QBBGLContext::destroySurface(), QBBGLContext::doneCurrent(), QXlibWindow::doSizeHints(), QBBWindow::frontBuffer(), QBBWindow::gainedFocus(), QBBGLContext::getProcAddress(), QWaylandEglWindow::glContext(), QXcbWindow::glContext(), QBBWindow::glContext(), QXlibWindow::glContext(), QXcbWindow::handleButtonPressEvent(), QXcbWindow::handleClientMessageEvent(), QXlibWindow::handleCloseEvent(), QXcbWindow::handleConfigureNotifyEvent(), QXlibWindow::handleEnterEvent(), QXcbWindow::handleEnterNotifyEvent(), QXcbWindow::handleExposeEvent(), QXcbWindow::handleFocusInEvent(), QXlibWindow::handleFocusInEvent(), QXlibWindow::handleLeaveEvent(), QXcbWindow::handleLeaveNotifyEvent(), QXcbWindow::handleMouseEvent(), QXlibWindow::handleMouseEvent(), QWaylandInputDevice::inputHandleButton(), QWaylandInputDevice::inputHandleKey(), QWaylandInputDevice::inputHandleKeyboardFocus(), QWaylandInputDevice::inputHandleMotion(), QWaylandInputDevice::inputHandlePointerFocus(), QBBWindow::lower(), QBBGLContext::makeCurrent(), QWaylandEglWindow::newSurfaceCreated(), QXlibWindow::paintEvent(), QBBWindow::post(), QBBGLContext::QBBGLContext(), QBBWindow::QBBWindow(), QDirectFbWindow::QDirectFbWindow(), QDri2Context::QDri2Context(), QBBWindow::raise(), QBBWindow::renderBuffer(), requestActivateWindow(), QBBWindow::requestActivateWindow(), QXlibWindow::resizeEvent(), QBBScreen::resizeNativeWidgetWindow(), QBBGLContext::resizeSurface(), QBBScreen::resizeTopLevelWindow(), QBBScreen::resizeWindows(), QBBWindow::setBufferSize(), QEglFSWindow::setGeometry(), QDirectFbWindow::setGeometry(), QOpenKODEWindow::setGeometry(), QBBWindow::setGeometry(), QVFbWindow::setGeometry(), QBBWindow::setOpacity(), QBBWindow::setParent(), QBBWindow::setScreen(), QXcbWindow::setVisible(), QBBWindow::setVisible(), QXlibWindow::setVisible(), QXlibWindow::setWindowFlags(), QBBGLContext::swapBuffers(), QBBScreen::topMostChildWindow(), QUIKitWindow::updateGeometryAndOrientation(), QCocoaWindow::windowDidResize(), QBBGLContext::~QBBGLContext(), and QBBWindow::~QBBWindow().
|
virtual |
Returns the effective window flags for this surface.
Reimplemented in QFbWindow, and QXlibWindow.
Definition at line 126 of file qplatformwindow_qpa.cpp.
|
virtual |
Reimplement in subclasses to return a handle to the native window.
Reimplemented in QFbWindow, QXlibWindow, QBBWindow, QDirectFbWindow, QWaylandWindow, QXcbWindow, QOpenKODEWindow, QCocoaWindow, and QEglFSWindow.
Definition at line 135 of file qplatformwindow_qpa.cpp.
Referenced by q_createNativeChildrenAndSetParent(), and QXlibWindow::setParent().
|
protected |
Definition at line 87 of file qplatformwindow_qpa.h.