diff options
Diffstat (limited to 'src/render/frontend')
-rw-r--r-- | src/render/frontend/qabstractfunctor.h | 8 | ||||
-rw-r--r-- | src/render/frontend/qlevelofdetail.cpp | 33 | ||||
-rw-r--r-- | src/render/frontend/qlevelofdetailswitch.cpp | 8 | ||||
-rw-r--r-- | src/render/frontend/qrenderaspect.cpp | 4 |
4 files changed, 19 insertions, 34 deletions
diff --git a/src/render/frontend/qabstractfunctor.h b/src/render/frontend/qabstractfunctor.h index c05c04743..95f6aee51 100644 --- a/src/render/frontend/qabstractfunctor.h +++ b/src/render/frontend/qabstractfunctor.h @@ -80,6 +80,14 @@ public: virtual ~QAbstractFunctor(); virtual qintptr id() const = 0; + // TODO: Remove when moving a copy of this to Qt3DCore + template<class T> + const T *functor_cast(const QAbstractFunctor *other) const + { + if (other->id() == functorTypeId<T>()) + return static_cast<const T *>(other); + return nullptr; + } private: Q_DISABLE_COPY(QAbstractFunctor) }; diff --git a/src/render/frontend/qlevelofdetail.cpp b/src/render/frontend/qlevelofdetail.cpp index df169876e..03df4e6a8 100644 --- a/src/render/frontend/qlevelofdetail.cpp +++ b/src/render/frontend/qlevelofdetail.cpp @@ -77,7 +77,7 @@ QLevelOfDetailPrivate::QLevelOfDetailPrivate() The currentIndex property can then be used, for example, to enable or disable entities, change material, etc. - The LevelOfDetail component is not shareable between multiple Entity's. + The LevelOfDetail component is not shareable between multiple \l [QML]{Entity}{entities}. \code #include <Qt3DCore/QEntity> @@ -185,35 +185,6 @@ QLevelOfDetailPrivate::QLevelOfDetailPrivate() * \sa Qt3DRender::QLevelOfDetail::ThresholdType */ - -/*! - * \enum Qt3DRender::QLevelOfDetail::SizeProxyMode - * - * Specifies what is used as a proxy for the entity when computing distance - * or size. - * - * \value LevelOfDetailBoundingSphere use the bounding sphere specified by the center - * and radius properties. - * \value Children LevelOfDetailBoundingSphere use the bounding sphere of the entity the - * component is attached to. - */ - -/*! - * \qmlproperty enumeration LevelOfDetail::SizeProxyMode - * - * Specifies what is used as a proxy for the entity when computing distance - * or size. - * - * \list - * \li LevelOfDetailBoundingSphere use the bounding sphere specified by the center - * and radius properties. - * \li Children LevelOfDetailBoundingSphere use the bounding sphere of the entity the - * component is attached to. - * \endlist - * \sa Qt3DRender::QLevelOfDetail::SizeProxyMode - */ - - /*! * \qmlproperty Camera LevelOfDetail::camera * @@ -442,7 +413,7 @@ void QLevelOfDetail::setThresholds(const QVector<qreal> &thresholds) Q_D(QLevelOfDetail); if (d->m_thresholds != thresholds) { d->m_thresholds = thresholds; - thresholdsChanged(d->m_thresholds); + emit thresholdsChanged(d->m_thresholds); } } diff --git a/src/render/frontend/qlevelofdetailswitch.cpp b/src/render/frontend/qlevelofdetailswitch.cpp index a6d2b1530..845fdd5a6 100644 --- a/src/render/frontend/qlevelofdetailswitch.cpp +++ b/src/render/frontend/qlevelofdetailswitch.cpp @@ -69,11 +69,17 @@ namespace Qt3DRender { This component is assigned to an entity. When the entity changes distance relative to the camera, the LevelOfDetailSwitch will disable all the child entities except - the one matching index \l LevelOfDetailSwitch::currentIndex. + the one matching index \l currentIndex. \sa LevelOfDetail */ +/*! + \qmlproperty int LevelOfDetailSwitch::currentIndex + + The index of the presently selected child entity. +*/ + /*! \fn Qt3DRender::QLevelOfDetailSwitch::QLevelOfDetailSwitch(Qt3DCore::QNode *parent) Constructs a new QLevelOfDetailSwitch with the specified \a parent. */ diff --git a/src/render/frontend/qrenderaspect.cpp b/src/render/frontend/qrenderaspect.cpp index e962f3700..11c03e7db 100644 --- a/src/render/frontend/qrenderaspect.cpp +++ b/src/render/frontend/qrenderaspect.cpp @@ -267,7 +267,7 @@ void QRenderAspectPrivate::registerBackendTypes() q->registerBackendType<QObjectPicker>(QSharedPointer<Render::NodeFunctor<Render::ObjectPicker, Render::ObjectPickerManager> >::create(m_renderer)); // Plugins - for (QString plugin : m_pluginConfig) + for (const QString &plugin : m_pluginConfig) loadRenderPlugin(plugin); } @@ -608,7 +608,7 @@ void QRenderAspectPrivate::configurePlugin(const QString &plugin) if (!m_pluginConfig.contains(plugin)) { m_pluginConfig.append(plugin); - for (QRenderAspectPrivate *instance : m_instances) + for (QRenderAspectPrivate *instance : qAsConst(m_instances)) instance->loadRenderPlugin(plugin); } } |