summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaj Grönholm <kaj.gronholm@qt.io>2019-04-24 14:10:46 +0300
committerKaj Grönholm <kaj.gronholm@qt.io>2019-04-25 06:12:40 +0000
commit58c8c69a51af8185b08ff34a1e3e5a3736460032 (patch)
treed41df63f5ad57b1bd8a580eb197bcf27c6c30607
parent9e248966761bde540cd9d0f2dccedd35c0e19c0c (diff)
Fix timeline component dnd crash
Don't move object into component when it's the root component. Also don't call setTimeRange() for Text objects as it isn't called for other objects either. Fixes a crash when dnd object into component with subcomponent as the first tree object. Task-number: QT3DS-3324 Change-Id: I3995494028b09e184970170a414a801a1e4a4075 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r--src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp b/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
index 237f0413..c4f7c960 100644
--- a/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
+++ b/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
@@ -3193,7 +3193,9 @@ public:
|| inInsertType == DocumentEditorInsertType::NextSibling)
theParent = GetParent(inDest);
+ // Moving object into into non-root component
if (m_Bridge.IsComponentInstance(theParent)
+ && !m_Bridge.IsActiveComponent(theParent)
&& moveIntoComponent(inInstances, theParent, checkUniqueName, notifyRename)) {
return;
}
@@ -4428,9 +4430,11 @@ public:
return 0;
}
- // Create text instance
+ // Create text instance. Don't set timerange, matching to other
+ // objects creation in CBasicObjectDropSource::GenerateAssetCommand()
qt3dsdm::Qt3DSDMInstanceHandle theTextInstance =
- CreateSceneGraphInstance(ComposerObjectTypes::Text, inParent, inSlide);
+ CreateSceneGraphInstance(ComposerObjectTypes::Text, inParent, inSlide,
+ TInstanceHandle(), false);
// Set the Font property to the font file
m_PropertySystem.SetInstancePropertyValue(theTextInstance, m_Bridge.GetText().m_Font,