Copy displayed value rather than original value

(Respects value relation configuration and other widget settings
which modify the displayed value)
This commit is contained in:
Nyall Dawson 2016-06-02 11:16:22 +10:00
parent 3da460e443
commit 0c735420fc

View File

@ -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() );
}
}