aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/components/curveeditor/curveeditormodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/qmldesigner/components/curveeditor/curveeditormodel.cpp')
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/curveeditormodel.cpp23
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)) {