forked from qt-creator/qt-creator
QmlDesigner: Fix dynamic properties on material library init
Nodes with dynamic properties cannot be reparented under a newly created node in the same transaction without breaking said properties. To work around this issue, ensureMaterialLibraryNode() was split into two transactions. This also meant removing ensureMaterialLibraryNode() call from materialLibraryNode(), so now material library will only be created in response to model attach or qtquick3d import addition. This should still cover all cases where user doesn't manually remove the material library node. Fixes: QDS-8095 Change-Id: Icff449b2bee0da2b43b02bbf5e0d28189aa2b3a9 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -80,9 +80,7 @@ MaterialEditorView::MaterialEditorView(QWidget *parent)
|
||||
m_ensureMatLibTimer.callOnTimeout([this] {
|
||||
if (model() && model()->rewriterView() && !model()->rewriterView()->hasIncompleteTypeInformation()
|
||||
&& model()->rewriterView()->errors().isEmpty()) {
|
||||
executeInTransaction("MaterialEditorView::MaterialEditorView", [this] {
|
||||
ensureMaterialLibraryNode();
|
||||
});
|
||||
ensureMaterialLibraryNode();
|
||||
m_ensureMatLibTimer.stop();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user