Skip to content

Commit

Permalink
Improve "Copy Cell Content" action code
Browse files Browse the repository at this point in the history
(cherry picked from commit 5ad9fc0)
  • Loading branch information
nyalldawson committed Jun 2, 2020
1 parent 83e2e63 commit ae4e340
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gui/attributetable/qgsdualview.cpp
Expand Up @@ -699,7 +699,11 @@ void QgsDualView::viewWillShowContextMenu( QMenu *menu, const QModelIndex &atInd
QAction *copyContentAction = new QAction( tr( "Copy Cell Content" ), this );
copyContentAction->setData( QVariant::fromValue<QModelIndex>( atIndex ) );
menu->addAction( copyContentAction );
connect( copyContentAction, &QAction::triggered, this, &QgsDualView::copyCellContent );
connect( copyContentAction, &QAction::triggered, this, [atIndex, this]
{
QVariant var = mMasterModel->data( atIndex, Qt::DisplayRole );
QApplication::clipboard()->setText( var.toString() );
} );

QgsVectorLayer *vl = mFilterModel->layer();
QgsMapCanvas *canvas = mFilterModel->mapCanvas();
Expand Down

0 comments on commit ae4e340

Please sign in to comment.