From 5e6c9947ade7f9db0fbf217c6cea9ff67b1ae2be Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 26 Aug 2019 13:45:52 +0200 Subject: [PATCH 1/5] Update qbs submodule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To HEAD of 1.14 branch. Change-Id: I11b99311234f981c3f6917079c6119b475396d0a Reviewed-by: Jörg Bornemann --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index 94a097d95e9..817a292690c 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 94a097d95e9bfe485cebd7a5a9acd56301c54f04 +Subproject commit 817a292690ccdea7bae185319beb22ea653db946 From ca7e6bd1b178ead1017435cab8e2cf94d35eb4f2 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 26 Aug 2019 15:20:02 +0200 Subject: [PATCH 2/5] ProjectExplorer: Fix restoring the issues pane warning button state The wrong button function was called. This does not fully fix the linked problem for the default session, because there is the additional issue of TaskView::loadSettings() not getting called at all. Task-number: QTCREATORBUG-19388 Change-Id: I64dcec9c6d07c8ac614c9a2ecd783e7eaa1a204c Reviewed-by: Eike Ziller --- src/plugins/projectexplorer/taskwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index d864c8f5854..77fe6455edd 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -427,7 +427,7 @@ void TaskWindow::loadSettings() if (value.isValid()) { bool includeWarnings = value.toBool(); d->m_filter->setFilterIncludesWarnings(includeWarnings); - d->m_filterWarningsButton->setDown(d->m_filter->filterIncludesWarnings()); + d->m_filterWarningsButton->setChecked(d->m_filter->filterIncludesWarnings()); } } From 00b29fd90dec051646bbea2f1586be9bc654c1fb Mon Sep 17 00:00:00 2001 From: Knud Dollereder Date: Mon, 26 Aug 2019 15:12:58 +0200 Subject: [PATCH 3/5] Improve update behavior - Suppress reflections - Keep selection when updating the model Change-Id: I0e165f0019c8c24802193f3a59902876d4cb5060 Reviewed-by: Thomas Hartmann --- .../components/curveeditor/animationcurve.cpp | 14 ++- .../components/curveeditor/animationcurve.h | 2 + .../curveeditor/curveeditormodel.cpp | 5 +- .../curveeditor/detail/curveitem.cpp | 10 +- .../curveeditor/detail/graphicsscene.cpp | 9 +- .../curveeditor/detail/keyframeitem.cpp | 3 +- .../curveeditor/detail/treemodel.cpp | 52 +++++++++++ .../components/curveeditor/detail/treemodel.h | 20 +++- .../curveeditor/detail/treeview.cpp | 2 + .../components/curveeditor/treeitem.cpp | 33 +++++++ .../components/curveeditor/treeitem.h | 7 ++ .../animationcurveeditormodel.cpp | 93 +++++++++++-------- .../animationcurveeditormodel.h | 4 - .../timelineeditor/timelinetoolbar.cpp | 8 ++ .../timelineeditor/timelinetoolbar.h | 2 + .../timelineeditor/timelineview.cpp | 20 +++- .../components/timelineeditor/timelineview.h | 2 + .../timelineeditor/timelinewidget.cpp | 4 +- 18 files changed, 222 insertions(+), 68 deletions(-) diff --git a/src/plugins/qmldesigner/components/curveeditor/animationcurve.cpp b/src/plugins/qmldesigner/components/curveeditor/animationcurve.cpp index 2c716652fdf..bd11405bd2b 100644 --- a/src/plugins/qmldesigner/components/curveeditor/animationcurve.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/animationcurve.cpp @@ -61,12 +61,12 @@ AnimationCurve::AnimationCurve(const QEasingCurve &easing, const QPointF &start, }; QVector points = easing.toCubicSpline(); - int numSegments = points.count() / 3; + int numSegments = points.size() / 3; Keyframe current; Keyframe tmp(start); - current.setInterpolation(Keyframe::Interpolation::Bezier); + current.setInterpolation(Keyframe::Interpolation::Linear); tmp.setInterpolation(Keyframe::Interpolation::Bezier); for (int i = 0; i < numSegments; i++) { @@ -80,6 +80,8 @@ AnimationCurve::AnimationCurve(const QEasingCurve &easing, const QPointF &start, m_frames.push_back(current); + current.setInterpolation(tmp.interpolation()); + tmp.setLeftHandle(p2); tmp.setPosition(p3); } @@ -189,6 +191,14 @@ QPainterPath AnimationCurve::intersectionPath() const return path; } +Keyframe AnimationCurve::keyframeAt(size_t id) const +{ + if (id >= m_frames.size()) + return Keyframe(); + + return m_frames.at(id); +} + std::vector AnimationCurve::keyframes() const { return m_frames; diff --git a/src/plugins/qmldesigner/components/curveeditor/animationcurve.h b/src/plugins/qmldesigner/components/curveeditor/animationcurve.h index 18fd3330b0c..fbd75594da5 100644 --- a/src/plugins/qmldesigner/components/curveeditor/animationcurve.h +++ b/src/plugins/qmldesigner/components/curveeditor/animationcurve.h @@ -66,6 +66,8 @@ public: QPainterPath intersectionPath() const; + Keyframe keyframeAt(size_t id) const; + std::vector keyframes() const; std::vector extrema() const; diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditormodel.cpp b/src/plugins/qmldesigner/components/curveeditor/curveeditormodel.cpp index 3b8b26b763c..274da77ebfe 100644 --- a/src/plugins/qmldesigner/components/curveeditor/curveeditormodel.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/curveeditormodel.cpp @@ -35,7 +35,6 @@ CurveEditorModel::CurveEditorModel(QObject *parent) CurveEditorModel::~CurveEditorModel() {} - void CurveEditorModel::setCurrentFrame(int frame) { if (graphicsView()) @@ -54,6 +53,8 @@ void CurveEditorModel::setCurve(unsigned int id, const AnimationCurve &curve) void CurveEditorModel::reset(const std::vector &items) { + std::vector sel = selection(); + beginResetModel(); initialize(); @@ -65,6 +66,8 @@ void CurveEditorModel::reset(const std::vector &items) } endResetModel(); + + select(sel); } } // End namespace DesignTools. diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp index e1317265ff9..faa3c320eba 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp @@ -64,11 +64,7 @@ CurveItem::CurveItem(unsigned int id, const AnimationCurve &curve, QGraphicsItem setFlag(QGraphicsItem::ItemIsMovable, false); - for (auto frame : curve.keyframes()) { - auto *item = new KeyframeItem(frame, this); - QObject::connect(item, &KeyframeItem::redrawCurve, this, &CurveItem::emitCurveChanged); - m_keyframes.push_back(item); - } + setCurve(curve); } CurveItem::~CurveItem() {} @@ -334,7 +330,7 @@ void CurveItem::setInterpolation(Keyframe::Interpolation interpolation) prevItem->setKeyframe(segment.left()); currItem->setKeyframe(segment.right()); - m_itemDirty = true; + setDirty(true); } prevItem = currItem; @@ -380,7 +376,7 @@ void CurveItem::deleteSelectedKeyframes() void CurveItem::emitCurveChanged() { - m_itemDirty = true; + setDirty(true); update(); } diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp index 4cea35e098c..42a7f1b8a89 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp @@ -67,6 +67,8 @@ double GraphicsScene::maximumValue() const void GraphicsScene::addCurveItem(CurveItem *item) { m_dirty = true; + item->setDirty(false); + addItem(item); item->connect(this); } @@ -144,13 +146,10 @@ void GraphicsScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) // CurveItems might become invalid after a keyframe-drag operation. curveItem->restore(); - if (curveItem->contains(mouseEvent->scenePos())) - curveItem->setSelected(true); - if (curveItem->isDirty()) { - emit curveChanged(curveItem->id(), curveItem->curve()); - curveItem->setDirty(false); m_dirty = true; + curveItem->setDirty(false); + emit curveChanged(curveItem->id(), curveItem->curve()); } } } diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/keyframeitem.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/keyframeitem.cpp index 236fa5b484b..7bff0045647 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/keyframeitem.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/detail/keyframeitem.cpp @@ -203,7 +203,7 @@ void KeyframeItem::updatePosition(bool update) if (m_right) updateHandle(m_right, false); - if (update) { + if (update && position != oldPosition) { emit redrawCurve(); emit keyframeMoved(this, position - oldPosition); } @@ -307,7 +307,6 @@ QVariant KeyframeItem::itemChange(QGraphicsItem::GraphicsItemChange change, cons void KeyframeItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { SelectableItem::mousePressEvent(event); - if (auto *curveItem = qgraphicsitem_cast(parentItem())) curveItem->setHandleVisibility(false); } diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/treemodel.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/treemodel.cpp index 2e1b3f0a096..95ace49942e 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/treemodel.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/detail/treemodel.cpp @@ -26,6 +26,7 @@ #include "treemodel.h" #include "detail/graphicsview.h" #include "treeitem.h" +#include "treeview.h" #include @@ -125,6 +126,11 @@ int TreeModel::columnCount(const QModelIndex &parent) const return m_root->columnCount(); } +void TreeModel::setTreeView(TreeView *view) +{ + m_tree = view; +} + void TreeModel::setGraphicsView(GraphicsView *view) { m_view = view; @@ -135,6 +141,52 @@ GraphicsView *TreeModel::graphicsView() const return m_view; } +std::vector TreeModel::selection() const +{ + std::vector out; + for (auto &&index : m_tree->selectionModel()->selectedIndexes()) { + if (index.column() == 0) { + TreeItem *item = static_cast(index.internalPointer()); + out.push_back(item->path()); + } + } + return out; +} + +QModelIndex TreeModel::findIdx(const QString &name, const QModelIndex &parent) const +{ + for (int i = 0; i < rowCount(parent); ++i) { + QModelIndex idx = index(i, 0, parent); + if (idx.isValid()) { + TreeItem *item = static_cast(idx.internalPointer()); + if (item->name() == name) + return idx; + } + } + return QModelIndex(); +} + +QModelIndex TreeModel::indexOf(const TreeItem::Path &path) const +{ + QModelIndex parent; + for (size_t i = 0; i < path.size(); ++i) { + QModelIndex idx = findIdx(path[i], parent); + if (idx.isValid()) + parent = idx; + } + + return parent; +} + +void TreeModel::select(const std::vector &selection) +{ + for (auto &&sel : selection) { + QModelIndex idx = indexOf(sel); + if (idx.isValid()) + m_tree->selectionModel()->select(idx, QItemSelectionModel::Select); + } +} + void TreeModel::initialize() { if (m_root) diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/treemodel.h b/src/plugins/qmldesigner/components/curveeditor/detail/treemodel.h index 209b2ee506a..961ee492335 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/treemodel.h +++ b/src/plugins/qmldesigner/components/curveeditor/detail/treemodel.h @@ -25,6 +25,8 @@ #pragma once +#include "treeitem.h" + #include #include @@ -32,7 +34,7 @@ namespace DesignTools { class GraphicsView; -class TreeItem; +class TreeView; class TreeModel : public QAbstractItemModel { @@ -45,7 +47,9 @@ public: QVariant data(const QModelIndex &index, int role) const override; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + QVariant headerData(int section, + Qt::Orientation orientation, + int role = Qt::DisplayRole) const override; QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; @@ -55,20 +59,32 @@ public: int columnCount(const QModelIndex &parent = QModelIndex()) const override; + void setTreeView(TreeView *view); + void setGraphicsView(GraphicsView *view); protected: GraphicsView *graphicsView() const; + std::vector selection() const; + + void select(const std::vector &selection); + void initialize(); TreeItem *root(); TreeItem *find(unsigned int id); + QModelIndex findIdx(const QString &name, const QModelIndex &parent) const; + + QModelIndex indexOf(const TreeItem::Path &path) const; + private: GraphicsView *m_view; + TreeView *m_tree; + TreeItem *m_root; }; diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/treeview.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/treeview.cpp index 9dd99f0bc1d..87e299d9531 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/treeview.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/detail/treeview.cpp @@ -36,6 +36,8 @@ namespace DesignTools { TreeView::TreeView(CurveEditorModel *model, QWidget *parent) : QTreeView(parent) { + model->setTreeView(this); + setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); setUniformRowHeights(true); setRootIsDecorated(false); diff --git a/src/plugins/qmldesigner/components/curveeditor/treeitem.cpp b/src/plugins/qmldesigner/components/curveeditor/treeitem.cpp index dd145b38c02..2413daf16c4 100644 --- a/src/plugins/qmldesigner/components/curveeditor/treeitem.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/treeitem.cpp @@ -72,6 +72,25 @@ QString TreeItem::name() const return m_name; } +TreeItem::Path TreeItem::path() const +{ + Path fullName; + fullName.push_back(name()); + + TreeItem *parent = this->parent(); + while (parent) { + if (parent->name() == "Root") + break; + + fullName.push_back(parent->name()); + parent = parent->parent(); + } + + std::reverse(fullName.begin(), fullName.end()); + + return fullName; +} + bool TreeItem::hasChildren() const { return !m_children.empty(); @@ -87,6 +106,20 @@ bool TreeItem::pinned() const return m_pinned; } +bool TreeItem::compare(const std::vector &path) const +{ + auto thisPath = this->path(); + if (thisPath.size() != path.size()) + return false; + + for (size_t i = 0; i < thisPath.size(); ++i) { + if (thisPath[i] != path[i]) + return false; + } + + return true; +} + int TreeItem::row() const { if (m_parent) { diff --git a/src/plugins/qmldesigner/components/curveeditor/treeitem.h b/src/plugins/qmldesigner/components/curveeditor/treeitem.h index 0ae65d60aaf..b7873e22a7c 100644 --- a/src/plugins/qmldesigner/components/curveeditor/treeitem.h +++ b/src/plugins/qmldesigner/components/curveeditor/treeitem.h @@ -45,6 +45,9 @@ class PropertyTreeItem; class TreeItem { +public: + using Path = std::vector; + public: TreeItem(const QString &name); @@ -60,12 +63,16 @@ public: QString name() const; + Path path() const; + bool hasChildren() const; bool locked() const; bool pinned() const; + bool compare(const std::vector &path) const; + int row() const; int column() const; diff --git a/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp b/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp index e91d817772b..b88e1ada957 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp @@ -122,9 +122,7 @@ DesignTools::ValueType typeFrom(const QmlTimelineKeyframeGroup &group) if (group.valueType() == TypeName("integer") || group.valueType() == TypeName("int")) return DesignTools::ValueType::Integer; - // Ignoring types: - // QColor / HAlignment / VAlignment - + // Ignoring: QColor / HAlignment / VAlignment return DesignTools::ValueType::Undefined; } @@ -170,48 +168,61 @@ DesignTools::AnimationCurve AnimationCurveEditorModel::createAnimationCurve( } } +std::vector createKeyframes(QList nodes) +{ + auto byTime = [](const auto &a, const auto &b) { + return a.variantProperty("frame").value().toDouble() + < b.variantProperty("frame").value().toDouble(); + }; + std::sort(nodes.begin(), nodes.end(), byTime); + + std::vector frames; + for (auto &&node : nodes) { + QVariant timeVariant = node.variantProperty("frame").value(); + QVariant valueVariant = node.variantProperty("value").value(); + if (!timeVariant.isValid() || !valueVariant.isValid()) + continue; + + QPointF position(timeVariant.toDouble(), valueVariant.toDouble()); + + auto keyframe = DesignTools::Keyframe(position); + + if (node.hasBindingProperty("easing.bezierCurve")) { + EasingCurve ecurve; + ecurve.fromString(node.bindingProperty("easing.bezierCurve").expression()); + keyframe.setData(static_cast(ecurve)); + } + frames.push_back(keyframe); + } + return frames; +} + +std::vector resolveSmallCurves( + const std::vector &frames) +{ + std::vector out; + for (auto &&frame : frames) { + if (frame.hasData() && !out.empty()) { + QEasingCurve curve = frame.data().toEasingCurve(); + if (curve.toCubicSpline().count() == 3) { + DesignTools::Keyframe &previous = out.back(); + DesignTools::AnimationCurve acurve(curve, previous.position(), frame.position()); + previous = acurve.keyframeAt(0); + out.push_back(acurve.keyframeAt(1)); + continue; + } + } + out.push_back(frame); + } + return out; +} + DesignTools::AnimationCurve AnimationCurveEditorModel::createDoubleCurve( const QmlTimelineKeyframeGroup &group) { - std::vector keyframes; - for (auto &&frame : group.keyframePositions()) { - QVariant timeVariant = frame.variantProperty("frame").value(); - QVariant valueVariant = frame.variantProperty("value").value(); - - if (timeVariant.isValid() && valueVariant.isValid()) { - QPointF position(timeVariant.toDouble(), valueFromVariant(valueVariant)); - auto keyframe = DesignTools::Keyframe(position); - - if (frame.hasBindingProperty("easing.bezierCurve")) { - EasingCurve ecurve; - ecurve.fromString(frame.bindingProperty("easing.bezierCurve").expression()); - keyframe.setData(static_cast(ecurve)); - } - - keyframes.push_back(keyframe); - } - } + std::vector keyframes = createKeyframes(group.keyframePositions()); + keyframes = resolveSmallCurves(keyframes); return DesignTools::AnimationCurve(keyframes); } -double AnimationCurveEditorModel::valueFromVariant(const QVariant &variant) -{ - return variant.toDouble(); -} - -void AnimationCurveEditorModel::reset(const std::vector &items) -{ - beginResetModel(); - - initialize(); - - unsigned int counter = 0; - for (auto *item : items) { - item->setId(++counter); - root()->addChild(item); - } - - endResetModel(); -} - } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.h b/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.h index 8bb1cc4e471..fe85929cf1f 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.h +++ b/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.h @@ -60,10 +60,6 @@ private: DesignTools::AnimationCurve createDoubleCurve(const QmlTimelineKeyframeGroup &group); - double valueFromVariant(const QVariant &variant); - - void reset(const std::vector &items); - double m_minTime; double m_maxTime; diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp index 7a085700bb1..33c6dafa343 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp @@ -154,8 +154,16 @@ void TimelineToolBar::setCurrentState(const QString &name) m_stateLabel->setText(name); } +void TimelineToolBar::setBlockReflection(bool block) +{ + m_blockReflection = block; +} + void TimelineToolBar::setCurrentTimeline(const QmlTimeline &timeline) { + if (m_blockReflection) + return; + if (timeline.isValid()) { setStartFrame(timeline.startKeyframe()); setEndFrame(timeline.endKeyframe()); diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.h b/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.h index e5fa7a79c93..a95af873daf 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.h +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.h @@ -79,6 +79,7 @@ public: QString currentTimelineId() const; void setCurrentState(const QString &name); + void setBlockReflection(bool block); void setCurrentTimeline(const QmlTimeline &timeline); void setStartFrame(qreal frame); void setCurrentFrame(qreal frame); @@ -116,6 +117,7 @@ private: QLineEdit *m_lastFrame = nullptr; QAction *m_recording = nullptr; + bool m_blockReflection = false; }; } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp index 73b44d18a32..feb499916ca 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp @@ -142,7 +142,7 @@ void TimelineView::nodeRemoved(const ModelNode & /*removedNode*/, void TimelineView::nodeReparented(const ModelNode &node, const NodeAbstractProperty &newPropertyParent, const NodeAbstractProperty & /*oldPropertyParent*/, - AbstractView::PropertyChangeFlags /*propertyChange*/) + AbstractView::PropertyChangeFlags propertyChange) { if (newPropertyParent.isValid() && QmlTimelineKeyframeGroup::isValidQmlTimelineKeyframeGroup( @@ -151,7 +151,7 @@ void TimelineView::nodeReparented(const ModelNode &node, m_timelineWidget->graphicsScene()->invalidateSectionForTarget(frames.target()); QmlTimeline currentTimeline = m_timelineWidget->graphicsScene()->currentTimeline(); - if (currentTimeline.isValid()) + if (currentTimeline.isValid() && propertyChange == AbstractView::NoAdditionalChanges) m_timelineWidget->toolBar()->setCurrentTimeline(currentTimeline); } else if (QmlTimelineKeyframeGroup::checkKeyframesType( @@ -196,12 +196,26 @@ void TimelineView::variantPropertiesChanged(const QList &proper m_timelineWidget->graphicsScene()->invalidateKeyframesForTarget(frames.target()); QmlTimeline currentTimeline = m_timelineWidget->graphicsScene()->currentTimeline(); - m_timelineWidget->toolBar()->setCurrentTimeline(currentTimeline); + if (currentTimeline.isValid()) + m_timelineWidget->toolBar()->setCurrentTimeline(currentTimeline); } } } } +void TimelineView::bindingPropertiesChanged(const QList &propertyList, + AbstractView::PropertyChangeFlags propertyChange) +{ + Q_UNUSED(propertyChange) + for (const auto &property : propertyList) { + if (property.name() == "easing.bezierCurve") { + QmlTimeline currentTimeline = m_timelineWidget->graphicsScene()->currentTimeline(); + if (currentTimeline.isValid()) + m_timelineWidget->toolBar()->setCurrentTimeline(currentTimeline); + } + } +} + void TimelineView::selectedNodesChanged(const QList & /*selectedNodeList*/, const QList & /*lastSelectedNodeList*/) { diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineview.h b/src/plugins/qmldesigner/components/timelineeditor/timelineview.h index bf5d2694c5c..17ecc3b538e 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelineview.h +++ b/src/plugins/qmldesigner/components/timelineeditor/timelineview.h @@ -60,6 +60,8 @@ public: void instancePropertyChanged(const QList> &propertyList) override; void variantPropertiesChanged(const QList &propertyList, PropertyChangeFlags propertyChange) override; + void bindingPropertiesChanged(const QList &propertyList, + PropertyChangeFlags propertyChange) override; void selectedNodesChanged(const QList &selectedNodeList, const QList &lastSelectedNodeList) override; diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp index a7ab5d0491d..d4242b2d527 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp @@ -328,7 +328,8 @@ void TimelineWidget::updateAnimationCurve(DesignTools::PropertyTreeItem *item) QmlTimelineKeyframeGroup group = timelineKeyframeGroup(currentTimeline, item); if (group.isValid()) { - auto replaceKeyframes = [&group, currentTimeline, item]() { + auto replaceKeyframes = [&group, item, this]() { + m_toolbar->setBlockReflection(true); for (auto frame : group.keyframes()) frame.destroy(); @@ -353,6 +354,7 @@ void TimelineWidget::updateAnimationCurve(DesignTools::PropertyTreeItem *item) previous = frame; } + m_toolbar->setBlockReflection(false); }; timelineView()->executeInTransaction("TimelineWidget::handleKeyframeReplacement", From 8751d0c7d983a97ec2f0c557dde13b0c7592ea13 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 26 Aug 2019 14:50:04 +0200 Subject: [PATCH 4/5] QmlDesigner: Resize Loader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QDS-745 Change-Id: Idf126f5ed00cce74921a320d9bf17ef620ccd511 Reviewed-by: Henning Gründl Reviewed-by: Thomas Hartmann --- .../propertyEditorQmlSources/QtQuick/ItemPane.qml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml index a74fc94f1e5..5eb3a7cf854 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml @@ -247,8 +247,11 @@ Rectangle { active = true } + property int loaderHeight: specificsOne.item.height + tabView.extraHeight + onLoaderHeightChanged: tabView.specficsOneHeight = loaderHeight + onLoaded: { - tabView.specficsTwoHeight = specificsTwo.item.height + tabView.extraHeight + tabView.specficsTwoHeight = loaderHeight } } @@ -259,8 +262,11 @@ Rectangle { id: specificsOne; source: specificsUrl; + property int loaderHeight: specificsOne.item.height + tabView.extraHeight + onLoaderHeightChanged: tabView.specficsOneHeight = loaderHeight + onLoaded: { - tabView.specficsOneHeight = specificsOne.item.height + tabView.extraHeight + tabView.specficsOneHeight = loaderHeight } } } From 309e345818063507ed5bcd8151d670ebd43b6b9c Mon Sep 17 00:00:00 2001 From: Dmitry Nuzhdin Date: Sat, 24 Aug 2019 10:48:17 +0300 Subject: [PATCH 5/5] Debugger: Fix mapping std::set in Locals window via gdb Currently QtCreator incorrectly shows content of a std::set. For example set {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} is shown as {0, 1, 2, 1, 2, 1, 2, 1, 2}. Change-Id: Idaff66451827657ef129aa3d27895c43938e6fdc Reviewed-by: Orgad Shaneh Reviewed-by: hjk --- share/qtcreator/debugger/stdtypes.py | 2 +- tests/auto/debugger/tst_dumpers.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/share/qtcreator/debugger/stdtypes.py b/share/qtcreator/debugger/stdtypes.py index fb621353761..bdbaea14d5a 100644 --- a/share/qtcreator/debugger/stdtypes.py +++ b/share/qtcreator/debugger/stdtypes.py @@ -442,7 +442,7 @@ def qdump__std__set(d, value): d.putSubItem(i, val) if node["_M_right"].pointer() == 0: parent = node["_M_parent"] - while node == parent["_M_right"]: + while node.pointer() == parent["_M_right"].pointer(): node = parent parent = parent["_M_parent"] if node["_M_right"] != parent: diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index b179882643f..026846e7db6 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -4692,10 +4692,7 @@ void tst_Dumpers::dumper_data() "std::set s0;\n" "unused(&s0);\n\n" - "std::set s1;\n" - "s1.insert(11);\n" - "s1.insert(22);\n" - "s1.insert(33);\n" + "std::set s1{11, 22, 33, 44, 55, 66, 77, 88};\n" "unused(&s1);\n\n" "typedef std::set Set;\n" @@ -4716,9 +4713,13 @@ void tst_Dumpers::dumper_data() "s3.insert(3);\n" "s3.insert(3);\n") + + Cxx11Profile() + Check("s0", "<0 items>", "std::set") - + Check("s1", "<3 items>", "std::set") + + Check("s1", "<8 items>", "std::set") + + Check("s1.0", "[0]", "11", "int") + + Check("s1.1", "[1]", "22", "int") + + Check("s1.5", "[5]", "66", "int") + Check("s2", "<3 items>", TypeDef("std::set", "Set")) + Check("it1.value", "11", "int")