diff options
author | Janne Kangas <janne.kangas@qt.io> | 2019-07-26 14:49:10 +0300 |
---|---|---|
committer | Janne Kangas <janne.kangas@qt.io> | 2019-08-19 07:27:57 +0300 |
commit | 8efc601abad8425b2b720f7378347c05ff07d074 (patch) | |
tree | 4536dcead41eeff21503aee47907012df97f68ea /src/api | |
parent | 29c75d2ec7dad33e85510dd58238b771e58a1d4e (diff) |
Check for datainput validity at setValue
Change-Id: Ia54802faa760021e3afabc977f6d0bdcee31deca
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/studio3d/q3dspresentation.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/api/studio3d/q3dspresentation.cpp b/src/api/studio3d/q3dspresentation.cpp index 9484792..beb0394 100644 --- a/src/api/studio3d/q3dspresentation.cpp +++ b/src/api/studio3d/q3dspresentation.cpp @@ -852,12 +852,16 @@ void Q3DSPresentation::setGlobalAnimationTime(qint64 milliseconds) */ void Q3DSPresentation::setDataInputValue(const QString &name, const QVariant &value, bool force) { + auto di = d_ptr->m_dataInputs.value(name, nullptr); + if (!di) + return; + // Set directly to avoid loop between Q3DSDataInput and Q3DSPresentation value setters. - d_ptr->m_dataInputs[name]->d_ptr->m_value = value; + di->d_ptr->m_value = value; // If we have had forced set during this frame, inherit force flag to all subsequent setters. - if (!d_ptr->m_dataInputs[name]->d_ptr->m_forced) - d_ptr->m_dataInputs[name]->d_ptr->m_forced = force; + if (!di->d_ptr->m_forced) + di->d_ptr->m_forced = force; d_ptr->setDataInputDirty(name, true); // We batch datainput changes within a frame, so just tell the presentation that one |