![]() |
NDEVR
API Documentation
|
A (hacky) class for storing a window into a container. More...
Public Member Functions | |
| WindowContainer (QWidget *parent=nullptr) | |
| Constructs a WindowContainer with an optional parent. | |
| bool | event (QEvent *event) override |
| Handles show/hide events and forwards all events to the optional event forwarder. | |
| void | paintEvent (QPaintEvent *event) override |
| Handles paint events, updating the embedded window size on non-special-window platforms. | |
| void | setEventForwarder (const std::function< bool(QEvent *event)> &forwarder) |
| Sets a callback function that receives all events for custom processing. | |
| void | setWidget (QWidget *window) |
| Sets a QWidget as the contained child widget. | |
| void | setWindow (QWindow *window) |
| Sets a QWindow as the contained window, wrapping it in a QWidget container. | |
| virtual void | updateSize () |
| Updates the geometry of the embedded container to match this widget's size and position. | |
| void | visibleHack () |
| Workaround to force proper visibility of the embedded window on some platforms. | |
| QPoint | windowOffset () const |
| Returns the global position offset for the embedded window. | |
Static Public Member Functions | |
| static Qt::WindowFlags | windowFlags () |
| Returns the platform-specific window flags for the embedded window. | |
Protected Attributes | |
| QWidget * | m_container |
| The QWidget wrapping the embedded window or set directly via setWidget(). | |
| std::function< bool(QEvent *event)> | m_event_forwarder |
| Optional callback that receives all events for custom handling. | |
| QSize | m_last_paint_size |
| The size at the last paint event, used for incremental repainting. | |
| QTimer * | m_location_timer |
| Timer used on some platforms to poll and update window position. | |
| QWindow * | m_window |
| The embedded QWindow, if set via setWindow(). | |
A (hacky) class for storing a window into a container.
This is used if the rendering engine for a particular widget is different from the one used by the application. The hackiness comes from Qt's limited support for this functionality which results in the need to hack around the errors in Qt's core library.
Definition at line 36 of file WindowContainer.h.
|
inline |
Constructs a WindowContainer with an optional parent.
| [in] | parent | The optional parent widget. |
Definition at line 41 of file WindowContainer.h.
References m_container, m_last_paint_size, m_location_timer, and m_window.
|
inline |
Sets a callback function that receives all events for custom processing.
| [in] | forwarder | The event forwarding function. |
Definition at line 251 of file WindowContainer.h.
References event(), and m_event_forwarder.
|
inline |
Sets a QWidget as the contained child widget.
| [in] | window | The widget to embed in this container. |
Definition at line 94 of file WindowContainer.h.
References m_container, and m_window.
|
inline |
Sets a QWindow as the contained window, wrapping it in a QWidget container.
| [in] | window | The QWindow to embed in this container. |
Definition at line 122 of file WindowContainer.h.
References m_container, m_window, and windowFlags().
|
inlinestatic |
Returns the platform-specific window flags for the embedded window.
Definition at line 67 of file WindowContainer.h.
Referenced by GLESCameraViewFactory::createView(), and setWindow().
|
inline |
Returns the global position offset for the embedded window.
Definition at line 84 of file WindowContainer.h.
Referenced by updateSize().