Skip to content

Commit

Permalink
Improve "Copy Cell Content" action code
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 2, 2020
1 parent c6ccf37 commit 61d627a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gui/attributetable/qgsdualview.cpp
Expand Up @@ -744,7 +744,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 61d627a

Please sign in to comment.