summaryrefslogtreecommitdiffstats
path: root/src/Viewer
diff options
context:
space:
mode:
Diffstat (limited to 'src/Viewer')
-rw-r--r--src/Viewer/studio3d/q3dssurfaceviewer.cpp17
-rw-r--r--src/Viewer/studio3d/q3dssurfaceviewer.h4
-rw-r--r--src/Viewer/studio3d/q3dssurfaceviewer_p.h1
3 files changed, 22 insertions, 0 deletions
diff --git a/src/Viewer/studio3d/q3dssurfaceviewer.cpp b/src/Viewer/studio3d/q3dssurfaceviewer.cpp
index f477723b..c64ecbfc 100644
--- a/src/Viewer/studio3d/q3dssurfaceviewer.cpp
+++ b/src/Viewer/studio3d/q3dssurfaceviewer.cpp
@@ -121,6 +121,11 @@ bool Q3DSSurfaceViewer::isRunning() const
return d_ptr->m_viewerApp != nullptr;
}
+QString Q3DSSurfaceViewer::presentationId() const
+{
+ return d_ptr->m_id;
+}
+
int Q3DSSurfaceViewer::fboId() const
{
return d_ptr->m_fboId;
@@ -146,6 +151,16 @@ Q3DSPresentation *Q3DSSurfaceViewer::presentation() const
return d_ptr->m_presentation;
}
+void Q3DSSurfaceViewer::setPresentationId(const QString &id)
+{
+ if (d_ptr->m_id != id) {
+ d_ptr->m_id = id;
+ Q_EMIT presentationIdChanged(id);
+ if (d_ptr->m_viewerApp)
+ d_ptr->m_viewerApp->setPresentationId(id);
+ }
+}
+
Q3DSSurfaceViewerPrivate::Q3DSSurfaceViewerPrivate(Q3DSSurfaceViewer *q)
: QObject(q)
, q_ptr(q)
@@ -159,6 +174,7 @@ Q3DSSurfaceViewerPrivate::Q3DSSurfaceViewerPrivate(Q3DSSurfaceViewer *q)
, m_autoSize(true)
, m_settings(new Q3DSViewerSettings(this))
, m_presentation(new Q3DSPresentation(this))
+ , m_id(QStringLiteral("initial"))
{
connect(m_presentation, &Q3DSPresentation::sourceChanged,
this, &Q3DSSurfaceViewerPrivate::reset);
@@ -362,6 +378,7 @@ bool Q3DSSurfaceViewerPrivate::initializeRuntime()
return false;
}
+ m_viewerApp->setPresentationId(m_id);
m_settings->d_ptr->setViewerApp(m_viewerApp);
m_presentation->d_ptr->setViewerApp(m_viewerApp);
diff --git a/src/Viewer/studio3d/q3dssurfaceviewer.h b/src/Viewer/studio3d/q3dssurfaceviewer.h
index 80c6692d..fc99ccaf 100644
--- a/src/Viewer/studio3d/q3dssurfaceviewer.h
+++ b/src/Viewer/studio3d/q3dssurfaceviewer.h
@@ -53,6 +53,7 @@ class Q_STUDIO3D_EXPORT Q3DSSurfaceViewer : public QObject
Q_PROPERTY(bool autoSize READ autoSize WRITE setAutoSize NOTIFY autoSizeChanged)
Q_PROPERTY(int updateInterval READ updateInterval WRITE setUpdateInterval NOTIFY updateIntervalChanged)
Q_PROPERTY(bool running READ isRunning NOTIFY runningChanged)
+ Q_PROPERTY(QString presentationId READ presentationId WRITE setPresentationId NOTIFY presentationIdChanged)
public:
explicit Q3DSSurfaceViewer(QObject *parent = nullptr);
@@ -67,6 +68,7 @@ public:
bool autoSize() const;
int updateInterval() const;
bool isRunning() const;
+ QString presentationId() const;
int fboId() const;
QSurface *surface() const;
@@ -82,6 +84,7 @@ public Q_SLOTS:
void update();
void shutdown();
void reset();
+ void setPresentationId(const QString &id);
Q_SIGNALS:
void sizeChanged(const QSize &size);
@@ -89,6 +92,7 @@ Q_SIGNALS:
void updateIntervalChanged(bool autoUpdate);
void runningChanged(bool initialized);
void frameUpdated();
+ void presentationIdChanged(const QString &id);
private:
Q_DISABLE_COPY(Q3DSSurfaceViewer)
diff --git a/src/Viewer/studio3d/q3dssurfaceviewer_p.h b/src/Viewer/studio3d/q3dssurfaceviewer_p.h
index f82e4ba3..a668513e 100644
--- a/src/Viewer/studio3d/q3dssurfaceviewer_p.h
+++ b/src/Viewer/studio3d/q3dssurfaceviewer_p.h
@@ -94,6 +94,7 @@ private:
bool m_autoSize;
Q3DSViewerSettings *m_settings;
Q3DSPresentation *m_presentation;
+ QString m_id;
};
QT_END_NAMESPACE