Skip to content
Permalink
Browse files

Improve "Copy Cell Content" action code

  • Loading branch information
nyalldawson committed Jun 2, 2020
1 parent c6ccf37 commit 61d627ab9eb9da10f9eb19ff2bba7ac3ad3034f5
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/gui/attributetable/qgsdualview.cpp
@@ -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();

0 comments on commit 61d627a

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