QmlDesigner Connection View signals fixes

Bug: QDS-1333
Change-Id: Ic0d4206888bd8c5bd3d5cef29225441f19efa59d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Aleksei German
2019-12-11 11:25:13 +01:00
parent f265257d55
commit ec43ac0481
8 changed files with 46 additions and 4 deletions

View File

@@ -290,7 +290,28 @@ void ConnectionModel::abstractPropertyChanged(const AbstractProperty &abstractPr
void ConnectionModel::deleteConnectionByRow(int currentRow)
{
signalHandlerPropertyForRow(currentRow).parentModelNode().destroy();
SignalHandlerProperty targetSignal = signalHandlerPropertyForRow(currentRow);
QmlDesigner::ModelNode node = targetSignal.parentModelNode();
QList<SignalHandlerProperty> allSignals = node.signalProperties();
if (allSignals.size() > 1) {
if (allSignals.contains(targetSignal))
node.removeProperty(targetSignal.name());
}
else {
node.destroy();
}
}
void ConnectionModel::removeRowFromTable(const SignalHandlerProperty &property)
{
for (int currentRow = 0; currentRow < rowCount(); currentRow++) {
SignalHandlerProperty targetSignal = signalHandlerPropertyForRow(currentRow);
if (targetSignal == property) {
removeRow(currentRow);
break;
}
}
}
void ConnectionModel::handleException()