aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp')
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp
index e8dd168580..9f5ed0b7af 100644
--- a/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp
+++ b/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp
@@ -336,7 +336,7 @@ void CurveItem::setCurve(const AnimationCurve &curve)
{
freeClear(m_keyframes);
- for (auto frame : curve.keyframes()) {
+ for (const auto &frame : curve.keyframes()) {
auto *item = new KeyframeItem(frame, this);
item->setLocked(locked());
item->setComponentTransform(m_transform);
@@ -413,6 +413,9 @@ void CurveItem::connect(GraphicsScene *scene)
void CurveItem::insertKeyframeByTime(double time)
{
+ if (locked())
+ return;
+
AnimationCurve acurve = curve();
acurve.insert(time);
setCurve(acurve);