Skip to content

Commit

Permalink
Fix broken QgsDualView::copyCellContent() method
Browse files Browse the repository at this point in the history
This is a public method, yet was unusable publicly due to the
forced use of sender() to retrieve the current model index
  • Loading branch information
nyalldawson committed Jun 2, 2020
1 parent 61d627a commit 2376263
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/gui/attributetable/qgsdualview.cpp
Expand Up @@ -704,14 +704,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()
Expand Down

0 comments on commit 2376263

Please sign in to comment.