C

Q3DSWidget Class

A widget that renders Qt 3D Studio presentations using OpenGL. More...

Header: #include <Q3DSWidget>
qmake: QT += 3dstudioruntime2
Since: Qt 3D Studio 2.0
Inherits: QOpenGLWidget

Properties

  • 59 properties inherited from QWidget
  • 1 property inherited from QObject

Public Functions

Q3DSWidget(QWidget *parent = nullptr)
virtual ~Q3DSWidget()
QString error() const
bool isRunning() const
Q3DSPresentation *presentation() const
void setUpdateInterval(int interval)
Q3DSViewerSettings *settings() const
int updateInterval() const

Signals

Static Public Members

const QMetaObject staticMetaObject
  • 5 static public members inherited from QWidget
  • 9 static public members inherited from QObject

Additional Inherited Members

  • 19 public slots inherited from QWidget
  • 1 public slot inherited from QObject
  • 5 protected functions inherited from QOpenGLWidget
  • 35 protected functions inherited from QWidget
  • 9 protected functions inherited from QObject
  • 1 protected function inherited from QPaintDevice
  • 1 protected slot inherited from QWidget

Detailed Description

A widget that renders Qt 3D Studio presentations using OpenGL.

Q3DSWidget is a widget that can be used to embed Qt 3D Studio presentations into QWidget-based applications.

Q3DSWidget is used to specify a render widget for Qt 3D Studio presentation. It subclasses QOpenGLWidget, which means all considerations that should be taken when working with QOpenGLWidget apply to Q3DSWidget as well. Refer to the QOpenGLWidget documentation for details.

Example Usage

Q3DSWidget *viewer = new Q3DSWidget(parentWidget);
viewer->presentation()->setSource(QUrl(QStringLiteral("qrc:/my_presentation.uip")));
viewer->setUpdateInterval(0);

// Register a scene element object for slide management (optional)
Q3DSSceneElement scene(viewer->presentation(), QStringLiteral("Scene"));

// Register an element object for attribute setting (optional)
Q3DSElement element(viewer->presentation(), QStringLiteral("myCarModel"));

See also Q3DSSurfaceViewer.

Property Documentation

error : const QString

Contains the text for the error message that was generated during the loading of the presentation. When no error occurred or there is no presentation loaded, the value is an empty string.

This property is read-only.

Access functions:

QString error() const

Notifier signal:

void errorChanged()

presentation : Q3DSPresentation* const

Returns the presentation object used by the Q3DSWidget.

This property is read-only.

Access functions:

Q3DSPresentation *presentation() const

running : const bool

The value of this property is true when the presentation has been loaded and is ready to be shown.

This property is read-only.

Access functions:

bool isRunning() const

Notifier signal:

void runningChanged()

updateInterval : int

Holds the viewer update interval in milliseconds. If the value is negative, the viewer doesn't update the presentation automatically.

The default value is 0, meaning automatic updates are enabled.

Access functions:

int updateInterval() const
void setUpdateInterval(int interval)

Notifier signal:

void updateIntervalChanged()

See also QWidget::update().

Member Function Documentation

Q3DSWidget::Q3DSWidget(QWidget *parent = nullptr)

Default constructs an instance of Q3DSWidget.

[virtual] Q3DSWidget::~Q3DSWidget()

Destroys the instance of Q3DSWidget. The destructor is virtual.

[signal] void Q3DSWidget::frameUpdate()

This signal is emitted each time a frame has been rendered.

[signal] void Q3DSWidget::presentationLoaded()

This signal is emitted when the presentation has been loaded and is ready to be shown.

Q3DSViewerSettings *Q3DSWidget::settings() const

Returns the settings object used by the Q3DSWidget.

Available under certain Qt licenses.
Find out more.