Skip to content

Commit

Permalink
Use edit role when querying values for completer in Browse Data tab
Browse files Browse the repository at this point in the history
This makes sure the cell contents are not modified for display purposes
(e.g. by truncating them to a maximum display length).
  • Loading branch information
MKleusberg committed Sep 28, 2018
1 parent 88d1cbc commit b4b933c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ExtendedTableWidget.cpp
Expand Up @@ -108,7 +108,7 @@ UniqueFilterModel::UniqueFilterModel(QObject* parent)
bool UniqueFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const bool UniqueFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
{ {
QModelIndex index = sourceModel()->index(sourceRow, filterKeyColumn(), sourceParent); QModelIndex index = sourceModel()->index(sourceRow, filterKeyColumn(), sourceParent);
const QString& value = index.data().toString(); const QString& value = index.data(Qt::EditRole).toString();


if (!value.isEmpty() && !m_uniqueValues.contains(value)) { if (!value.isEmpty() && !m_uniqueValues.contains(value)) {
const_cast<UniqueFilterModel*>(this)->m_uniqueValues.insert(value); const_cast<UniqueFilterModel*>(this)->m_uniqueValues.insert(value);
Expand Down

0 comments on commit b4b933c

Please sign in to comment.