Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
Make keyframe selection change layer selection
Luna Lovecraft8965a0dd68ca
diff --git a/plugins/dockers/animation/KisAnimTimelineFramesModel.cpp b/plugins/dockers/animation/KisAnimTimelineFramesModel.cppindex dc97ef4a28..d986240c79 100644--- a/plugins/dockers/animation/KisAnimTimelineFramesModel.cpp+++ b/plugins/dockers/animation/KisAnimTimelineFramesModel.cpp@@ -843,6 +843,12 @@ bool KisAnimTimelineFramesModel::removeRows(int row, int count, const QModelIndereturn result;}+void KisAnimTimelineFramesModel::requestNodeChange(const QModelIndex& nodeIndex)+{+ KisNodeSP node = nodeAt(nodeIndex);+ Q_EMIT requestCurrentNodeChanged(node);+}+bool KisAnimTimelineFramesModel::insertOtherLayer(int index, int dstRow){Q_UNUSED(dstRow);diff --git a/plugins/dockers/animation/KisAnimTimelineFramesModel.h b/plugins/dockers/animation/KisAnimTimelineFramesModel.hindex d4b485bc97..e2ec214746 100644--- a/plugins/dockers/animation/KisAnimTimelineFramesModel.h+++ b/plugins/dockers/animation/KisAnimTimelineFramesModel.h@@ -111,6 +111,8 @@ public:bool insertRows(int row, int count, const QModelIndex &parent) override;bool removeRows(int row, int count, const QModelIndex &parent) override;+ void requestNodeChange(const QModelIndex& nodeIndex);+enum ItemDataRole{ActiveLayerRole = KisTimeBasedItemModel::UserRole,diff --git a/plugins/dockers/animation/KisAnimTimelineFramesView.cpp b/plugins/dockers/animation/KisAnimTimelineFramesView.cppindex d10891e819..75f88b342a 100644--- a/plugins/dockers/animation/KisAnimTimelineFramesView.cpp+++ b/plugins/dockers/animation/KisAnimTimelineFramesView.cpp@@ -1341,6 +1341,10 @@ void KisAnimTimelineFramesView::currentChanged(const QModelIndex ¤t, constm_d->model->setData(current, QVariant(int(SEEK_FINALIZE | SEEK_PUSH_AUDIO)), KisAnimTimelineFramesModel::ScrubToRole);}}++ if (current.row() != previous.row()) {+ m_d->model->requestNodeChange(current);+ }}QItemSelectionModel::SelectionFlags KisAnimTimelineFramesView::selectionCommand(const QModelIndex &index,