diff options
Diffstat (limited to 'src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timelineanimationform.cpp')
-rw-r--r-- | src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timelineanimationform.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timelineanimationform.cpp b/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timelineanimationform.cpp index 4fc04b5759..65f77a0e5f 100644 --- a/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timelineanimationform.cpp +++ b/src/plugins/qmldesigner/qmldesignerextension/timelineeditor/timelineanimationform.cpp @@ -85,14 +85,23 @@ TimelineAnimationForm::TimelineAnimationForm(QWidget *parent) if (newId == animation().id()) return; - if (!animation().isValidId(newId)) { + bool error = false; + + if (!ModelNode::isValidId(newId)) { Core::AsynchronousMessageBox::warning(tr("Invalid Id"), tr("%1 is an invalid id.").arg(newId)); + error = true; } else if (animation().view()->hasId(newId)) { Core::AsynchronousMessageBox::warning(tr("Invalid Id"), tr("%1 already exists.").arg(newId)); } else { animation().setIdWithRefactoring(newId); + error = true; + } + + if (error) { + lastString.clear(); + ui->idLineEdit->setText(animation().id()); } }); |