summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2017-05-21 08:26:29 +0100
committerSean Harmer <sean.harmer@kdab.com>2017-05-21 08:26:29 +0100
commit9f8fc3717508a6b8045f65e6c820692fb67dc450 (patch)
treead426afcaa91f61ecd669fbc416838f108554771 /src/core
parenta830a9365832fd52c1849768543a64c55e4cee0a (diff)
parentcd9059a22604307f483764db134d51b15c540758 (diff)
Merge branch '5.9' into dev
Conflicts: .qmake.conf src/core/qscene.cpp src/plugins/sceneparsers/gltf/gltfimporter.cpp src/plugins/sceneparsers/gltfexport/gltfexporter.cpp src/render/texture/gltexture.cpp Change-Id: I7bde0fc0177eae252fef01cc43725fcf69c13a80
Diffstat (limited to 'src/core')
-rw-r--r--src/core/aspects/qaspectengine.cpp2
-rw-r--r--src/core/configure.json2
-rw-r--r--src/core/nodes/qbackendnode.cpp2
-rw-r--r--src/core/nodes/qnode.cpp18
-rw-r--r--src/core/services/qabstractframeadvanceservice_p.h1
-rw-r--r--src/core/services/qeventfilterservice_p.h1
-rw-r--r--src/core/services/qopenglinformationservice_p.h1
-rw-r--r--src/core/services/qsysteminformationservice_p.h1
-rw-r--r--src/core/services/qtickclockservice_p.h1
9 files changed, 24 insertions, 5 deletions
diff --git a/src/core/aspects/qaspectengine.cpp b/src/core/aspects/qaspectengine.cpp
index a3fda90b0..b9c9d2283 100644
--- a/src/core/aspects/qaspectengine.cpp
+++ b/src/core/aspects/qaspectengine.cpp
@@ -103,8 +103,8 @@ QAspectEnginePrivate::~QAspectEnginePrivate()
*/
void QAspectEnginePrivate::initNode(QNode *node)
{
- QNodePrivate::get(node)->setScene(m_scene);
m_scene->addObservable(node);
+ QNodePrivate::get(node)->setScene(m_scene);
}
void QAspectEnginePrivate::initEntity(QEntity *entity)
diff --git a/src/core/configure.json b/src/core/configure.json
index 86b31223f..47a726d82 100644
--- a/src/core/configure.json
+++ b/src/core/configure.json
@@ -4,7 +4,7 @@
"commandline": {
"options": {
- "assimp": { "type": "enum", "values": [ "qt", "system" ] },
+ "assimp": { "type": "enum", "values": [ "qt", "system", "no" ] },
"qt3d-profile-jobs": "boolean",
"qt3d-profile-gl": "boolean"
}
diff --git a/src/core/nodes/qbackendnode.cpp b/src/core/nodes/qbackendnode.cpp
index e3963b202..dc751cb93 100644
--- a/src/core/nodes/qbackendnode.cpp
+++ b/src/core/nodes/qbackendnode.cpp
@@ -233,7 +233,7 @@ void QBackendNode::sceneChangeEvent(const QSceneChangePtr &e)
switch (e->type()) {
case PropertyUpdated: {
if (propertyChange->propertyName() == QByteArrayLiteral("enabled"))
- d->m_enabled = propertyChange->value().value<bool>();
+ d->m_enabled = propertyChange->value().toBool();
break;
}
default:
diff --git a/src/core/nodes/qnode.cpp b/src/core/nodes/qnode.cpp
index 42c8887ce..ce5e76a55 100644
--- a/src/core/nodes/qnode.cpp
+++ b/src/core/nodes/qnode.cpp
@@ -114,7 +114,7 @@ void QNodePrivate::notifyCreationChange()
Q_Q(QNode);
// Do nothing if we already have already sent a node creation change
// and not a subsequent node destroyed change.
- if (m_hasBackendNode)
+ if (m_hasBackendNode || !m_scene)
return;
QNodeCreatedChangeGenerator generator(q);
const auto creationChanges = generator.creationChanges();
@@ -305,7 +305,21 @@ void QNodePrivate::_q_setParentHelper(QNode *parent)
visitor.traverse(q, newParentNode->d_func(), &QNodePrivate::setSceneHelper);
}
- notifyCreationChange();
+ // We want to make sure that subTreeRoot is always created before
+ // child.
+ // Given a case such as below
+ // QEntity *subTreeRoot = new QEntity(someGlobalExisitingRoot)
+ // QEntity *child = new QEntity();
+ // child->setParent(subTreeRoot)
+ // We need to take into account that subTreeRoot needs to be
+ // created in the backend before the child.
+ // Therefore we only call notifyCreationChanges if the parent
+ // hasn't been created yet as we know that when the parent will be
+ // fully created, it will also send the changes for all of its
+ // children
+
+ if (QNodePrivate::get(newParentNode)->m_hasBackendNode)
+ notifyCreationChange();
}
// If we have a valid new parent, we let him know that we are its child
diff --git a/src/core/services/qabstractframeadvanceservice_p.h b/src/core/services/qabstractframeadvanceservice_p.h
index a5f635710..dac72a98d 100644
--- a/src/core/services/qabstractframeadvanceservice_p.h
+++ b/src/core/services/qabstractframeadvanceservice_p.h
@@ -64,6 +64,7 @@ class QAbstractFrameAdvanceServicePrivate;
class QT3DCORESHARED_EXPORT QAbstractFrameAdvanceService : public QAbstractServiceProvider
{
+ Q_OBJECT
public:
virtual qint64 waitForNextFrame() = 0;
virtual void start() = 0;
diff --git a/src/core/services/qeventfilterservice_p.h b/src/core/services/qeventfilterservice_p.h
index 5f779c9cd..58b87d9cc 100644
--- a/src/core/services/qeventfilterservice_p.h
+++ b/src/core/services/qeventfilterservice_p.h
@@ -63,6 +63,7 @@ class QEventFilterServicePrivate;
class QT3DCORESHARED_EXPORT QEventFilterService : public QAbstractServiceProvider
{
+ Q_OBJECT
public:
QEventFilterService();
~QEventFilterService();
diff --git a/src/core/services/qopenglinformationservice_p.h b/src/core/services/qopenglinformationservice_p.h
index c84c5ed10..2adf73307 100644
--- a/src/core/services/qopenglinformationservice_p.h
+++ b/src/core/services/qopenglinformationservice_p.h
@@ -65,6 +65,7 @@ class QOpenGLInformationServicePrivate;
class QT3DCORESHARED_EXPORT QOpenGLInformationService : public QAbstractServiceProvider
{
+ Q_OBJECT
public:
virtual QSurfaceFormat format() const = 0;
diff --git a/src/core/services/qsysteminformationservice_p.h b/src/core/services/qsysteminformationservice_p.h
index 0ab737817..01e976b77 100644
--- a/src/core/services/qsysteminformationservice_p.h
+++ b/src/core/services/qsysteminformationservice_p.h
@@ -64,6 +64,7 @@ class QSystemInformationServicePrivate;
class QT3DCORESHARED_EXPORT QSystemInformationService : public QAbstractServiceProvider
{
+ Q_OBJECT
public:
virtual QStringList aspectNames() const = 0;
virtual int threadPoolThreadCount() const = 0;
diff --git a/src/core/services/qtickclockservice_p.h b/src/core/services/qtickclockservice_p.h
index 53f3cf310..6f02643f4 100644
--- a/src/core/services/qtickclockservice_p.h
+++ b/src/core/services/qtickclockservice_p.h
@@ -61,6 +61,7 @@ class QTickClockServicePrivate;
class QTickClockService : public QAbstractFrameAdvanceService
{
+ Q_OBJECT
public:
QTickClockService();
~QTickClockService();