QmlDesigner: Do not keep separate selection state

When nodes are deleted the selection can changes without a notifier.
There is no reason to keep the selection separately.

Change-Id: I166d3695762e3d5cd6ff4808586384fd26bafef4
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
Thomas Hartmann
2020-10-05 10:16:54 +02:00
parent 634bb8afb4
commit fe7d928f3b
4 changed files with 6 additions and 10 deletions

View File

@@ -128,10 +128,10 @@ void DynamicPropertiesModel::resetModel()
{
beginResetModel();
clear();
setHorizontalHeaderLabels(QStringList({ tr("Item"), tr("Property"), tr("Property Type"),
tr("Property Value") }));
setHorizontalHeaderLabels(
QStringList({tr("Item"), tr("Property"), tr("Property Type"), tr("Property Value")}));
foreach (const ModelNode modelNode, m_selectedModelNodes)
for (const ModelNode modelNode : connectionView()->selectedModelNodes())
addModelNode(modelNode);
endResetModel();
@@ -279,7 +279,6 @@ void DynamicPropertiesModel::bindingRemoved(const BindingProperty &bindingProper
void DynamicPropertiesModel::selectionChanged(const QList<ModelNode> &selectedNodes)
{
m_handleDataChanged = false;
m_selectedModelNodes = selectedNodes;
resetModel();
m_handleDataChanged = true;
}