diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2020-07-08 18:39:17 +0200 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2020-08-07 09:37:57 +0000 |
commit | 8b04c7ff0cb7481d2333771973a05df5dceda15d (patch) | |
tree | ad25c070fd15f281c381822b2aae7291e7d533e3 | |
parent | 5343490eb44590e11cc9e8b4bc42efbc2bb051a6 (diff) |
QmlDesigner: Warn if no properties can be animated in transitions
Do not fail silently.
Change-Id: Id8470f8b81a75dc660906ed53538e75563068527
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r-- | src/plugins/qmldesigner/components/transitioneditor/transitioneditorview.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/qmldesigner/components/transitioneditor/transitioneditorview.cpp b/src/plugins/qmldesigner/components/transitioneditor/transitioneditorview.cpp index a7ead0afd2..71f6c3ed88 100644 --- a/src/plugins/qmldesigner/components/transitioneditor/transitioneditorview.cpp +++ b/src/plugins/qmldesigner/components/transitioneditor/transitioneditorview.cpp @@ -272,6 +272,16 @@ ModelNode TransitionEditorView::addNewTransition() } } }); + } else { + QString properties; + for (const PropertyName &property : validProperties) + properties.append(QString::fromUtf8(property) + ", "); + if (!properties.isEmpty()) + properties.chop(2); + Core::AsynchronousMessageBox::warning( + tr("No properties to animate found."), + tr("To add transitions, first change the properties that you want to animate in states (%1).") + .arg(properties)); } if (m_transitionEditorWidget) @@ -285,9 +295,6 @@ TransitionEditorWidget *TransitionEditorView::createWidget() if (!m_transitionEditorWidget) m_transitionEditorWidget = new TransitionEditorWidget(this); - //auto *timelineContext = new TimelineContext(m_timelineWidget); - //Core::ICore::addContextObject(timelineContext); - return m_transitionEditorWidget; } |