Skip to content

Commit 0c73542

Browse files
committed
Copy displayed value rather than original value
(Respects value relation configuration and other widget settings which modify the displayed value)
1 parent 3da460e commit 0c73542

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/gui/attributetable/qgsdualview.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,7 @@ void QgsDualView::copyCellContent() const
387387
if ( action && action->data().isValid() && action->data().canConvert<QModelIndex>() )
388388
{
389389
QModelIndex index = action->data().value<QModelIndex>();
390-
391-
QgsFeature f = masterModel()->feature( index );
392-
int attrIndex = mMasterModel->fieldIdx( index.column() );
393-
QVariant var = f.attributes().at( attrIndex );
390+
QVariant var = masterModel()->data( index, Qt::DisplayRole );
394391
QApplication::clipboard()->setText( var.toString() );
395392
}
396393
}

0 commit comments

Comments
 (0)