Skip to content
Permalink
Browse files

Improve "Copy Cell Content" action code

(cherry picked from commit 5ad9fc0)
(cherry picked from commit ae4e340)
  • Loading branch information
nyalldawson committed Jun 19, 2020
1 parent 3d321ab commit d512ee04239cb50ee01210f289cbcbe2869b4a35
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/gui/attributetable/qgsdualview.cpp
@@ -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();

0 comments on commit d512ee0

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