diff options
author | Knud Dollereder <knud.dollereder@qt.io> | 2020-02-21 15:28:31 +0100 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2020-03-17 17:19:14 +0000 |
commit | 5b000d17cb2f42891db7bd8c9c857866245eddd3 (patch) | |
tree | 97b2a33c6be95de50028e24e2d2f0e85ac262055 /src/plugins/qmldesigner/components/curveeditor/curveeditormodel.cpp | |
parent | 0f60f120d2e24b9912b43b5ba4859adcd5a1a803 (diff) |
QmlDesigner: Add the ability to modify the animation rangev4.12.0-beta2
Add the ability to modify the animation range from the curve editor
Fix a synchronization issue between timeline and curve editor when
the animation contains pinned curves
Change-Id: I89dda234063259f41d662749d696f5fc8a04f988
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner/components/curveeditor/curveeditormodel.cpp')
-rw-r--r-- | src/plugins/qmldesigner/components/curveeditor/curveeditormodel.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditormodel.cpp b/src/plugins/qmldesigner/components/curveeditor/curveeditormodel.cpp index 1769c1d6dd..e6f0f3e326 100644 --- a/src/plugins/qmldesigner/components/curveeditor/curveeditormodel.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/curveeditormodel.cpp @@ -25,13 +25,16 @@ #include "curveeditormodel.h" #include "treeitem.h" + #include "detail/graphicsview.h" #include "detail/selectionmodel.h" namespace DesignTools { -CurveEditorModel::CurveEditorModel(QObject *parent) +CurveEditorModel::CurveEditorModel(double minTime, double maxTime, QObject *parent) : TreeModel(parent) + , m_minTime(minTime) + , m_maxTime(maxTime) {} CurveEditorModel::~CurveEditorModel() {} @@ -42,6 +45,24 @@ void CurveEditorModel::setCurrentFrame(int frame) graphicsView()->setCurrentFrame(frame); } +void CurveEditorModel::setMinimumTime(double time, bool internal) +{ + m_minTime = time; + if (internal) + emit updateStartFrame(m_minTime); + else + emit startFrameChanged(m_minTime); +} + +void CurveEditorModel::setMaximumTime(double time, bool internal) +{ + m_maxTime = time; + if (internal) + emit updateEndFrame(m_maxTime); + else + emit endFrameChanged(m_maxTime); +} + void CurveEditorModel::setCurve(unsigned int id, const AnimationCurve &curve) { if (TreeItem *item = find(id)) { |