Skip to content

Commit

Permalink
Copy displayed value rather than original value
Browse files Browse the repository at this point in the history
(Respects value relation configuration and other widget settings
which modify the displayed value)
  • Loading branch information
nyalldawson committed Jun 2, 2016
1 parent 3da460e commit 0c73542
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/gui/attributetable/qgsdualview.cpp
Expand Up @@ -387,10 +387,7 @@ void QgsDualView::copyCellContent() const
if ( action && action->data().isValid() && action->data().canConvert<QModelIndex>() )
{
QModelIndex index = action->data().value<QModelIndex>();

QgsFeature f = masterModel()->feature( index );
int attrIndex = mMasterModel->fieldIdx( index.column() );
QVariant var = f.attributes().at( attrIndex );
QVariant var = masterModel()->data( index, Qt::DisplayRole );
QApplication::clipboard()->setText( var.toString() );
}
}
Expand Down

1 comment on commit 0c73542

@3nids
Copy link
Member

@3nids 3nids commented on 0c73542 Jun 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you rock!

Please sign in to comment.