NDEVR
API Documentation
QTGraphicsWidget

A Widget wrapper around a QTGraphicsWindow that allows it to be used inside the UI framework. More...

Inheritance diagram for QTGraphicsWidget:
[legend]
Collaboration diagram for QTGraphicsWidget:
[legend]

Public Member Functions

 QTGraphicsWidget (QTGraphicsWindow *window, QWidget *parent=nullptr)
 Constructs the widget wrapper around a graphics window.
virtual ~QTGraphicsWidget ()
 Destructor.
bool eventCallback (QEvent *event)
 Handles events forwarded from the widget.
bool eventFilter (QObject *watched, QEvent *e) override
 Event filter for forwarding events to the graphics window.
QTGraphicsWindowgraphicsWindow ()
 Returns the contained graphics window.
void mouseInScreenSignal (bool mouse_in_screen)
 Emitted when the mouse enters or leaves the widget.
void setCamera (const DynamicPointer< Camera > &camera)
 Sets the camera for the contained graphics window.
void setModelManager (QTModelManager *manager)
 Sets the model manager for the contained window.
void updateBackgroundColor ()
 Updates the widget background from the camera settings.
void updateSize () override
 Updates the widget and window size.
Public Member Functions inherited from WindowContainer
 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.
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.

Protected Attributes

RGBColor m_background_color = Constant<RGBColor>::Invalid
 Cached background color.
QTimer * m_check_visibility_timer
 Timer for checking visibility changes.
QTGraphicsWindowm_window
 The contained graphics window.
Protected Attributes inherited from WindowContainer
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().

Additional Inherited Members

Static Public Member Functions inherited from WindowContainer
static Qt::WindowFlags windowFlags ()
 Returns the platform-specific window flags for the embedded window.

Detailed Description

A Widget wrapper around a QTGraphicsWindow that allows it to be used inside the UI framework.


Definition at line 183 of file QtGraphicsWindow.h.

Constructor & Destructor Documentation

◆ QTGraphicsWidget()

QTGraphicsWidget::QTGraphicsWidget ( QTGraphicsWindow * window,
QWidget * parent = nullptr )

Constructs the widget wrapper around a graphics window.

Parameters
[in]windowThe graphics window.
[in]parentOptional parent widget.

Member Function Documentation

◆ eventCallback()

bool QTGraphicsWidget::eventCallback ( QEvent * event)

Handles events forwarded from the widget.

Parameters
[in]eventThe event.
Returns
True if handled.

References WindowContainer::event().

◆ eventFilter()

bool QTGraphicsWidget::eventFilter ( QObject * watched,
QEvent * e )
override

Event filter for forwarding events to the graphics window.

Parameters
[in]watchedThe watched object.
[in]eThe event.
Returns
True if filtered.

◆ graphicsWindow()

QTGraphicsWindow * QTGraphicsWidget::graphicsWindow ( )
inline

Returns the contained graphics window.

Returns
The graphics window pointer.

Definition at line 214 of file QtGraphicsWindow.h.

References m_window.

◆ mouseInScreenSignal()

void QTGraphicsWidget::mouseInScreenSignal ( bool mouse_in_screen)

Emitted when the mouse enters or leaves the widget.

Parameters
[in]mouse_in_screenWhether the mouse is in the widget.

◆ setCamera()

void QTGraphicsWidget::setCamera ( const DynamicPointer< Camera > & camera)

Sets the camera for the contained graphics window.

Parameters
[in]cameraThe camera pointer.

◆ setModelManager()

void QTGraphicsWidget::setModelManager ( QTModelManager * manager)

Sets the model manager for the contained window.

Parameters
[in]managerThe model manager.

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