diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-12-13 10:46:43 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-12-13 10:47:04 +0100 |
commit | bfb58a7fff934fde6f4c2b4c989f411b43aee8d9 (patch) | |
tree | 432201a0c7fb6c49d7835f728fc0da97d8742b39 /src/extras | |
parent | f660c657092811e77aa0ffb8145d6b060464292c (diff) | |
parent | d69e2c2b42719e6839f32e8ab796cf22d9f29bfa (diff) |
Merge remote-tracking branch 'origin/5.10' into dev
Change-Id: Ib51c8311ce78b2fec62dd0c09cb943a85a7d0b2b
Diffstat (limited to 'src/extras')
32 files changed, 66 insertions, 20 deletions
diff --git a/src/extras/defaults/qdiffusemapmaterial.cpp b/src/extras/defaults/qdiffusemapmaterial.cpp index 26fb99c2c..d5e729b8e 100644 --- a/src/extras/defaults/qdiffusemapmaterial.cpp +++ b/src/extras/defaults/qdiffusemapmaterial.cpp @@ -202,7 +202,7 @@ void QDiffuseMapMaterialPrivate::handleTextureScaleChanged(const QVariant &var) \inherits Qt3DRender::QMaterial \deprecated - \see Qt3DExtras::QDiffuseSpecularMaterial + This class is deprecated; use Qt3DExtras::QDiffuseSpecularMaterial instead. The specular lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. The relative strengths of these components are controlled by means of diff --git a/src/extras/defaults/qdiffusespecularmapmaterial.cpp b/src/extras/defaults/qdiffusespecularmapmaterial.cpp index 727eaed27..0acf610e9 100644 --- a/src/extras/defaults/qdiffusespecularmapmaterial.cpp +++ b/src/extras/defaults/qdiffusespecularmapmaterial.cpp @@ -209,7 +209,7 @@ void QDiffuseSpecularMapMaterialPrivate::handleTextureScaleChanged(const QVarian \inherits Qt3DRender::QMaterial \deprecated - \see Qt3DExtras::QDiffuseSpecularMaterial + This class is deprecated; use Qt3DExtras::QDiffuseSpecularMaterial instead. The specular lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. The relative strengths of these components are controlled by means of diff --git a/src/extras/defaults/qdiffusespecularmaterial.cpp b/src/extras/defaults/qdiffusespecularmaterial.cpp index 83bba9e41..14e1c2766 100644 --- a/src/extras/defaults/qdiffusespecularmaterial.cpp +++ b/src/extras/defaults/qdiffusespecularmaterial.cpp @@ -211,6 +211,7 @@ void QDiffuseSpecularMaterialPrivate::handleTextureScaleChanged(const QVariant & /*! \class Qt3DExtras::QDiffuseSpecularMaterial + \ingroup qt3d-extras-materials \brief The QDiffuseSpecularMaterial class provides a default implementation of the phong lighting effect. \inmodule Qt3DExtras diff --git a/src/extras/defaults/qfirstpersoncameracontroller.cpp b/src/extras/defaults/qfirstpersoncameracontroller.cpp index 2ad997d05..0561bbc37 100644 --- a/src/extras/defaults/qfirstpersoncameracontroller.cpp +++ b/src/extras/defaults/qfirstpersoncameracontroller.cpp @@ -44,6 +44,7 @@ namespace Qt3DExtras { /*! \class Qt3DExtras::QFirstPersonCameraController + \ingroup qt3d-extras-cameracontrollers \brief The QFirstPersonCameraController class allows controlling the scene camera from the first person perspective. \inmodule Qt3DExtras diff --git a/src/extras/defaults/qforwardrenderer.cpp b/src/extras/defaults/qforwardrenderer.cpp index f3137ea2d..b02077298 100644 --- a/src/extras/defaults/qforwardrenderer.cpp +++ b/src/extras/defaults/qforwardrenderer.cpp @@ -48,6 +48,13 @@ #include <Qt3DRender/qfrustumculling.h> #include <Qt3DRender/qrendersurfaceselector.h> +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(extras); +#endif +} + QT_BEGIN_NAMESPACE using namespace Qt3DRender; @@ -68,6 +75,8 @@ void QForwardRendererPrivate::init() { Q_Q(QForwardRenderer); + initResources(); + m_frustumCulling->setParent(m_clearBuffer); m_clearBuffer->setParent(m_cameraSelector); m_cameraSelector->setParent(m_viewport); diff --git a/src/extras/defaults/qgoochmaterial.cpp b/src/extras/defaults/qgoochmaterial.cpp index ba7ef8dab..57ec359b3 100644 --- a/src/extras/defaults/qgoochmaterial.cpp +++ b/src/extras/defaults/qgoochmaterial.cpp @@ -188,6 +188,7 @@ void QGoochMaterialPrivate::handleShininessChanged(const QVariant &var) /*! \class Qt3DExtras::QGoochMaterial + \ingroup qt3d-extras-materials \brief The QGoochMaterial provides a material that implements the Gooch shading model, popular in CAD and CAM applications. \inmodule Qt3DExtras diff --git a/src/extras/defaults/qmetalroughmaterial.cpp b/src/extras/defaults/qmetalroughmaterial.cpp index 4d537f20f..1cf114423 100644 --- a/src/extras/defaults/qmetalroughmaterial.cpp +++ b/src/extras/defaults/qmetalroughmaterial.cpp @@ -161,6 +161,7 @@ void QMetalRoughMaterialPrivate::handleTextureScaleChanged(const QVariant &var) /*! \class Qt3DExtras::QMetalRoughMaterial + \ingroup qt3d-extras-materials \brief The QMetalRoughMaterial provides a default implementation of PBR lighting. \inmodule Qt3DExtras diff --git a/src/extras/defaults/qmorphphongmaterial.cpp b/src/extras/defaults/qmorphphongmaterial.cpp index 4b22e8765..ade9f8542 100644 --- a/src/extras/defaults/qmorphphongmaterial.cpp +++ b/src/extras/defaults/qmorphphongmaterial.cpp @@ -169,6 +169,7 @@ void QMorphPhongMaterialPrivate::handleInterpolatorChanged(const QVariant &var) /*! \class Qt3DExtras::QMorphPhongMaterial + \ingroup qt3d-extras-materials \brief The QMorphPhongMaterial class provides a default implementation of the phong lighting effect. \inmodule Qt3DExtras \since 5.7 diff --git a/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp b/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp index 9b2a64520..27fda6879 100644 --- a/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp +++ b/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp @@ -166,7 +166,7 @@ void QNormalDiffuseMapAlphaMaterialPrivate::init() \inherits Qt3DExtras::QNormalDiffuseMapMaterial \deprecated - \see Qt3DExtras::QDiffuseSpecularMaterial + This class is deprecated; use Qt3DExtras::QDiffuseSpecularMaterial instead. The specular lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. The relative strengths of these components are controlled by means of diff --git a/src/extras/defaults/qnormaldiffusemapmaterial.cpp b/src/extras/defaults/qnormaldiffusemapmaterial.cpp index beed4085e..7c8260084 100644 --- a/src/extras/defaults/qnormaldiffusemapmaterial.cpp +++ b/src/extras/defaults/qnormaldiffusemapmaterial.cpp @@ -219,7 +219,7 @@ void QNormalDiffuseMapMaterialPrivate::handleTextureScaleChanged(const QVariant \inherits Qt3DRender::QMaterial \deprecated - \see Qt3DExtras::QDiffuseSpecularMaterial + This class is deprecated; use QDiffuseSpecularMaterial instead. The specular lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. The relative strengths of these components are controlled by means of diff --git a/src/extras/defaults/qnormaldiffusespecularmapmaterial.cpp b/src/extras/defaults/qnormaldiffusespecularmapmaterial.cpp index 028fd14e7..5fb2b7e9e 100644 --- a/src/extras/defaults/qnormaldiffusespecularmapmaterial.cpp +++ b/src/extras/defaults/qnormaldiffusespecularmapmaterial.cpp @@ -227,7 +227,7 @@ void QNormalDiffuseSpecularMapMaterialPrivate::handleTextureScaleChanged(const Q \inherits Qt3DRender::QMaterial \deprecated - \see Qt3DExtras::QDiffuseSpecularMaterial + This class is deprecated; use QDiffuseSpecularMaterial instead. The specular lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. The relative strengths of these components are controlled by means of diff --git a/src/extras/defaults/qorbitcameracontroller.cpp b/src/extras/defaults/qorbitcameracontroller.cpp index c4f976f89..61b930569 100644 --- a/src/extras/defaults/qorbitcameracontroller.cpp +++ b/src/extras/defaults/qorbitcameracontroller.cpp @@ -49,6 +49,7 @@ QOrbitCameraControllerPrivate::QOrbitCameraControllerPrivate() /*! \class Qt3DExtras::QOrbitCameraController + \ingroup qt3d-extras-cameracontrollers \brief The QOrbitCameraController class allows controlling the scene camera along orbital path. \inmodule Qt3DExtras \since 5.7 diff --git a/src/extras/defaults/qpervertexcolormaterial.cpp b/src/extras/defaults/qpervertexcolormaterial.cpp index 5619a71e7..f0462039e 100644 --- a/src/extras/defaults/qpervertexcolormaterial.cpp +++ b/src/extras/defaults/qpervertexcolormaterial.cpp @@ -75,6 +75,7 @@ QPerVertexColorMaterialPrivate::QPerVertexColorMaterialPrivate() /*! \class Qt3DExtras::QPerVertexColorMaterial + \ingroup qt3d-extras-materials \brief The QPerVertexColorMaterial class provides a default implementation for rendering the color properties set for each vertex. \inmodule Qt3DExtras diff --git a/src/extras/defaults/qphongalphamaterial.cpp b/src/extras/defaults/qphongalphamaterial.cpp index 24cff94e9..2f705072f 100644 --- a/src/extras/defaults/qphongalphamaterial.cpp +++ b/src/extras/defaults/qphongalphamaterial.cpp @@ -210,7 +210,7 @@ void QPhongAlphaMaterialPrivate::handleShininessChanged(const QVariant &var) \inherits Qt3DRender::QMaterial \deprecated - \see Qt3DExtras::QDiffuseSpecularMaterial + This class is deprecated; use QDiffuseSpecularMaterial instead. The phong lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. The relative strengths of these components are controlled by means of their diff --git a/src/extras/defaults/qphongmaterial.cpp b/src/extras/defaults/qphongmaterial.cpp index 17d837568..6318ea140 100644 --- a/src/extras/defaults/qphongmaterial.cpp +++ b/src/extras/defaults/qphongmaterial.cpp @@ -185,7 +185,7 @@ void QPhongMaterialPrivate::handleShininessChanged(const QVariant &var) \inherits Qt3DRender::QMaterial \deprecated - \see Qt3DExtras::QDiffuseSpecularMaterial + This class is deprecated; use QDiffuseSpecularMaterial instead. The phong lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. The relative strengths of these components are controlled by means of their diff --git a/src/extras/defaults/qskyboxentity.cpp b/src/extras/defaults/qskyboxentity.cpp index 202ba4fcb..df6547083 100644 --- a/src/extras/defaults/qskyboxentity.cpp +++ b/src/extras/defaults/qskyboxentity.cpp @@ -40,6 +40,7 @@ #include "qskyboxentity.h" #include "qskyboxentity_p.h" +#include <QtCore/qtimer.h> #include <Qt3DRender/qfilterkey.h> #include <Qt3DRender/qeffect.h> #include <Qt3DRender/qtexture.h> @@ -86,6 +87,7 @@ QSkyboxEntityPrivate::QSkyboxEntityPrivate() , m_negYImage(new QTextureImage()) , m_negZImage(new QTextureImage()) , m_extension(QStringLiteral(".png")) + , m_hasPendingReloadTextureCall(false) { m_loadedTexture->setGenerateMipMaps(false); } @@ -191,17 +193,23 @@ void QSkyboxEntityPrivate::init() */ void QSkyboxEntityPrivate::reloadTexture() { - if (m_extension == QStringLiteral(".dds")) { - m_loadedTexture->setSource(QUrl(m_baseName + m_extension)); - m_textureParameter->setValue(QVariant::fromValue(m_loadedTexture)); - } else { - m_posXImage->setSource(QUrl(m_baseName + QStringLiteral("_posx") + m_extension)); - m_posYImage->setSource(QUrl(m_baseName + QStringLiteral("_posy") + m_extension)); - m_posZImage->setSource(QUrl(m_baseName + QStringLiteral("_posz") + m_extension)); - m_negXImage->setSource(QUrl(m_baseName + QStringLiteral("_negx") + m_extension)); - m_negYImage->setSource(QUrl(m_baseName + QStringLiteral("_negy") + m_extension)); - m_negZImage->setSource(QUrl(m_baseName + QStringLiteral("_negz") + m_extension)); - m_textureParameter->setValue(QVariant::fromValue(m_skyboxTexture)); + if (!m_hasPendingReloadTextureCall) { + m_hasPendingReloadTextureCall = true; + QTimer::singleShot(0, [this] { + if (m_extension == QStringLiteral(".dds")) { + m_loadedTexture->setSource(QUrl(m_baseName + m_extension)); + m_textureParameter->setValue(QVariant::fromValue(m_loadedTexture)); + } else { + m_posXImage->setSource(QUrl(m_baseName + QStringLiteral("_posx") + m_extension)); + m_posYImage->setSource(QUrl(m_baseName + QStringLiteral("_posy") + m_extension)); + m_posZImage->setSource(QUrl(m_baseName + QStringLiteral("_posz") + m_extension)); + m_negXImage->setSource(QUrl(m_baseName + QStringLiteral("_negx") + m_extension)); + m_negYImage->setSource(QUrl(m_baseName + QStringLiteral("_negy") + m_extension)); + m_negZImage->setSource(QUrl(m_baseName + QStringLiteral("_negz") + m_extension)); + m_textureParameter->setValue(QVariant::fromValue(m_skyboxTexture)); + } + m_hasPendingReloadTextureCall = false; + }); } } diff --git a/src/extras/defaults/qskyboxentity_p.h b/src/extras/defaults/qskyboxentity_p.h index 88a40e2eb..945b42bf1 100644 --- a/src/extras/defaults/qskyboxentity_p.h +++ b/src/extras/defaults/qskyboxentity_p.h @@ -111,6 +111,7 @@ class QSkyboxEntityPrivate : public Qt3DCore::QEntityPrivate QString m_extension; QString m_baseName; QVector3D m_position; + bool m_hasPendingReloadTextureCall; }; } // Qt3DExtras diff --git a/src/extras/defaults/qt3dwindow.cpp b/src/extras/defaults/qt3dwindow.cpp index baa2aeddb..12e210f0d 100644 --- a/src/extras/defaults/qt3dwindow.cpp +++ b/src/extras/defaults/qt3dwindow.cpp @@ -62,6 +62,13 @@ #include <Qt3DRender/qcamera.h> #include <QtGui/qopenglcontext.h> +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(extras); +#endif +} + QT_BEGIN_NAMESPACE namespace Qt3DExtras { @@ -86,6 +93,8 @@ Qt3DWindow::Qt3DWindow(QScreen *screen) { Q_D(Qt3DWindow); + initResources(); + if (!d->parentWindow) d->connectToScreen(screen ? screen : d->topLevelScreen.data()); diff --git a/src/extras/defaults/qtexturedmetalroughmaterial.cpp b/src/extras/defaults/qtexturedmetalroughmaterial.cpp index 8e26ddccc..55d061fc3 100644 --- a/src/extras/defaults/qtexturedmetalroughmaterial.cpp +++ b/src/extras/defaults/qtexturedmetalroughmaterial.cpp @@ -45,13 +45,12 @@ namespace Qt3DExtras { /*! \class Qt3DExtras::QTexturedMetalRoughMaterial - \brief This is deprecated, please use QMetalRoughMaterial instead. + \brief This class is deprecated; use QMetalRoughMaterial instead. \inmodule Qt3DExtras \since 5.9 \inherits Qt3DExtras::QMetalRoughMaterial \deprecated - \see Qt3DExtras::QMetalRoughMaterial */ /*! diff --git a/src/extras/defaults/qtexturematerial.cpp b/src/extras/defaults/qtexturematerial.cpp index 32e60360e..6d57f3a49 100644 --- a/src/extras/defaults/qtexturematerial.cpp +++ b/src/extras/defaults/qtexturematerial.cpp @@ -143,6 +143,7 @@ void QTextureMaterialPrivate::handleTextureTransformChanged(const QVariant &var) /*! \class Qt3DExtras::QTextureMaterial + \ingroup qt3d-extras-materials \brief The QTextureMaterial provides a default implementation of a simple unlit texture material. \inmodule Qt3DExtras diff --git a/src/extras/geometries/qconegeometry.cpp b/src/extras/geometries/qconegeometry.cpp index a80e2a78a..2cf526142 100644 --- a/src/extras/geometries/qconegeometry.cpp +++ b/src/extras/geometries/qconegeometry.cpp @@ -39,6 +39,7 @@ /*! * \class Qt3DExtras::QConeGeometry + \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QConeGeometry * \inmodule Qt3DExtras * \brief The QConeGeometry class allows creation of a cone in 3D space. diff --git a/src/extras/geometries/qconemesh.cpp b/src/extras/geometries/qconemesh.cpp index 5e327df03..a0d1bd310 100644 --- a/src/extras/geometries/qconemesh.cpp +++ b/src/extras/geometries/qconemesh.cpp @@ -106,6 +106,7 @@ namespace Qt3DExtras { /*! * \class Qt3DExtras::QConeMesh + \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QConeMesh * \inmodule Qt3DExtras * diff --git a/src/extras/geometries/qcuboidgeometry.cpp b/src/extras/geometries/qcuboidgeometry.cpp index 9e6747c1e..f9efaaf9d 100644 --- a/src/extras/geometries/qcuboidgeometry.cpp +++ b/src/extras/geometries/qcuboidgeometry.cpp @@ -648,6 +648,7 @@ void QCuboidGeometryPrivate::init() /*! * \class Qt3DExtras::QCuboidGeometry + \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QCuboidGeometry * \inmodule Qt3DExtras * \brief The QCuboidGeometry class allows creation of a cuboid in 3D space. diff --git a/src/extras/geometries/qcuboidmesh.cpp b/src/extras/geometries/qcuboidmesh.cpp index 9e10d93a4..bdad566fc 100644 --- a/src/extras/geometries/qcuboidmesh.cpp +++ b/src/extras/geometries/qcuboidmesh.cpp @@ -96,6 +96,7 @@ namespace Qt3DExtras { /*! * \class Qt3DExtras::QCuboidMesh + \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QCuboidMesh * \inmodule Qt3DExtras * diff --git a/src/extras/geometries/qcylindergeometry.cpp b/src/extras/geometries/qcylindergeometry.cpp index c86b76d24..9d26068f2 100644 --- a/src/extras/geometries/qcylindergeometry.cpp +++ b/src/extras/geometries/qcylindergeometry.cpp @@ -409,6 +409,7 @@ void QCylinderGeometryPrivate::init() /*! * \class Qt3DExtras::QCylinderGeometry + \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QCylinderGeometry * \inmodule Qt3DExtras * \brief The QCylinderGeometry class allows creation of a cylinder in 3D space. diff --git a/src/extras/geometries/qcylindermesh.cpp b/src/extras/geometries/qcylindermesh.cpp index 02df6295f..792944cd5 100644 --- a/src/extras/geometries/qcylindermesh.cpp +++ b/src/extras/geometries/qcylindermesh.cpp @@ -91,6 +91,7 @@ namespace Qt3DExtras { /*! * \class Qt3DExtras::QCylinderMesh + \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QCylinderMesh * \inmodule Qt3DExtras * diff --git a/src/extras/geometries/qplanegeometry.cpp b/src/extras/geometries/qplanegeometry.cpp index 225726342..0176accdd 100644 --- a/src/extras/geometries/qplanegeometry.cpp +++ b/src/extras/geometries/qplanegeometry.cpp @@ -278,6 +278,7 @@ public: /*! * \class Qt3DExtras::QPlaneGeometry + \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QPlaneGeometry * \inmodule Qt3DExtras * \brief The QPlaneGeometry class allows creation of a plane in 3D space. diff --git a/src/extras/geometries/qplanemesh.cpp b/src/extras/geometries/qplanemesh.cpp index 4804df024..223e5a628 100644 --- a/src/extras/geometries/qplanemesh.cpp +++ b/src/extras/geometries/qplanemesh.cpp @@ -81,6 +81,7 @@ namespace Qt3DExtras { /*! * \class Qt3DExtras::QPlaneMesh + \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QPlaneMesh * \inmodule Qt3DExtras * diff --git a/src/extras/geometries/qspheregeometry.cpp b/src/extras/geometries/qspheregeometry.cpp index 1a3b50553..f5ec6bec2 100644 --- a/src/extras/geometries/qspheregeometry.cpp +++ b/src/extras/geometries/qspheregeometry.cpp @@ -382,6 +382,7 @@ void QSphereGeometryPrivate::init() /*! * \class Qt3DExtras::QSphereGeometry + \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QSphereGeometry * \inmodule Qt3DExtras * \brief The QSphereGeometry class allows creation of a sphere in 3D space. diff --git a/src/extras/geometries/qspheremesh.cpp b/src/extras/geometries/qspheremesh.cpp index 22089d7ab..28854fe29 100644 --- a/src/extras/geometries/qspheremesh.cpp +++ b/src/extras/geometries/qspheremesh.cpp @@ -80,6 +80,7 @@ namespace Qt3DExtras { /*! * \class Qt3DExtras::QSphereMesh + \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QSphereMesh * \inmodule Qt3DExtras * diff --git a/src/extras/geometries/qtorusgeometry.cpp b/src/extras/geometries/qtorusgeometry.cpp index 726b81c62..98707b03c 100644 --- a/src/extras/geometries/qtorusgeometry.cpp +++ b/src/extras/geometries/qtorusgeometry.cpp @@ -362,6 +362,7 @@ void QTorusGeometryPrivate::init() /*! * \class Qt3DExtras::QTorusGeometry + \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QTorusGeometry * \inmodule Qt3DExtras * \brief The QTorusGeometry class allows creation of a torus in 3D space. diff --git a/src/extras/geometries/qtorusmesh.cpp b/src/extras/geometries/qtorusmesh.cpp index 8e7c678db..fd10afc1e 100644 --- a/src/extras/geometries/qtorusmesh.cpp +++ b/src/extras/geometries/qtorusmesh.cpp @@ -83,6 +83,7 @@ namespace Qt3DExtras { /*! * \class Qt3DExtras::QTorusMesh + \ingroup qt3d-extras-geometries * \inheaderfile Qt3DExtras/QTorusMesh * \inmodule Qt3DExtras * |