diff options
author | Arno <arno@disconnect.de> | 2018-12-03 05:52:45 +0100 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2018-12-03 05:52:45 +0100 |
commit | 64673ef1f9936eb9b25fafb860852ca4c347d2fd (patch) | |
tree | d0b92083cef1ad3606f75c6d86d1aede0f99dd71 /mappingeditwidget.cpp | |
parent | f9704767ed8bc325f9224c69b2dd18f564ee5cc0 (diff) | |
download | SheMov-64673ef1f9936eb9b25fafb860852ca4c347d2fd.tar.gz SheMov-64673ef1f9936eb9b25fafb860852ca4c347d2fd.tar.bz2 SheMov-64673ef1f9936eb9b25fafb860852ca4c347d2fd.zip |
Add copyActor for new pics
If we already have an actor, get all mappings for all pics and fill the
result view. This only makes sense for actors, but should also work for
other items.
Diffstat (limited to 'mappingeditwidget.cpp')
-rw-r--r-- | mappingeditwidget.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mappingeditwidget.cpp b/mappingeditwidget.cpp index 936c5f1..86546c2 100644 --- a/mappingeditwidget.cpp +++ b/mappingeditwidget.cpp @@ -44,6 +44,8 @@ MappingEditWidget::MappingEditWidget(QWidget *parent) : QWidget(parent){ connect(mClearMapping, &QPushButton::clicked, this, &MappingEditWidget::clearMapping); mAddTree = new QPushButton(tr(">>>>")); connect(mAddTree, &QPushButton::clicked, this, &MappingEditWidget::addTree); + QPushButton *copyActorB = new QPushButton(tr("Copy")); + connect(copyActorB, &QPushButton::clicked, this, &MappingEditWidget::copyActor); //layout QHBoxLayout *mainLayout = new QHBoxLayout; @@ -54,6 +56,7 @@ MappingEditWidget::MappingEditWidget(QWidget *parent) : QWidget(parent){ buttonLayout->addWidget(mRemoveMapping); buttonLayout->addWidget(mClearMapping); buttonLayout->addWidget(mAddTree); + buttonLayout->addWidget(copyActorB); buttonLayout->addStretch(); mainLayout->addLayout(buttonLayout); mainLayout->addWidget(mMappingResult); @@ -167,3 +170,9 @@ void MappingEditWidget::resultSelectionChanged(const QModelIndex ¤t, const mMappingTree->mappingTreeView()->selectionModel()->select(real, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); mMappingTree->mappingTreeView()->scrollTo(real, QAbstractItemView::PositionAtCenter); } + +void MappingEditWidget::copyActor(){ + MappingData selected = mMappingTree->selectedItem(); + QList<MappingData> data = mMappingTree->mappingTreeModel()->siblingMappingDataFromId(selected.mappingId); + setMappings(data); +} |