Skip to content
Permalink
Browse files

Fix broken QgsDualView::copyCellContent() method

This is a public method, yet was unusable publicly due to the
forced use of sender() to retrieve the current model index

(cherry picked from commit 387b330)
(cherry picked from commit d9d3568)
  • Loading branch information
nyalldawson committed Jun 2, 2020
1 parent d512ee0 commit 3302b92bb7048e8b3b4c3b2ef7c9a794b0a658d6
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/gui/attributetable/qgsdualview.cpp
@@ -667,14 +667,14 @@ int QgsDualView::filteredFeatureCount()

void QgsDualView::copyCellContent() const
{
QAction *action = qobject_cast<QAction *>( sender() );

if ( action && action->data().isValid() && action->data().canConvert<QModelIndex>() )
const QModelIndex currentIndex = mTableView->currentIndex();
if ( !currentIndex.isValid() )
{
QModelIndex index = action->data().toModelIndex();
QVariant var = mMasterModel->data( index, Qt::DisplayRole );
QApplication::clipboard()->setText( var.toString() );
return;
}

QVariant var = mMasterModel->data( currentIndex, Qt::DisplayRole );
QApplication::clipboard()->setText( var.toString() );
}

void QgsDualView::cancelProgress()

0 comments on commit 3302b92

Please sign in to comment.
You can’t perform that action at this time.