Developer Documentation
Loading...
Searching...
No Matches
QtWidget (DATA_QT_WIDGET)

This type allows rendering QWidgets directly into the scene using the shader pipline renderer. At this time, only the left button and MouseMoveevents are supported since the right click is reserved for context menus. An example:

//create your own QWidget
//you can also use slots/signal to connect e.g. clicked() signal from the QPushButton
QWidget* emptyWidget = new QWidget();
QBoxLayout* layout = new QBoxLayout(QBoxLayout::LeftToRight);
emptyWidget->setLayout(layout);
//create a QtWidgetType
int id;
addEmptyObject(DATA_QT_WIDGET,id);
//assign the QWidget to the QtWidgetType and update it
qtObj->setWidget(emptyWidget);
emit updatedObject(id);
#define DATA_QT_WIDGET
Definition QtWidget.hh:59
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.

It is also possible to create a QtWidgetNode and assign it manually to one of you object. Ensure to inform the node about Mouse Events, when using the plain node. One example method is to pass the event directly to the node. Another method is to traverse the whole scenegraph like this:

void PluginName::slotMouseEvent(QMouseEvent* _event)
{
}
Viewer::ViewerProperties & viewerProperties(int _id)
Get the viewer properties Use this functions to get basic viewer properties such as backgroundcolor o...
void traverse(ACG::SceneGraph::MouseEventAction &_action)