Load the full cell data when trying to edit the cell content

In 11bff0ded8 a settings option was
introduced in order to limit the number of characters loaded into each
cell in the Browse Data tab.

However, when editing the cell you wouldn't see the full data, i.e.
rendering the data incomplete and/or cropping it when it's being edited
anyway. This commit fixes this behaviour: when editing a cell (either
in-line or using the edit dialog/dock) the full data for this particular
cell is loaded and shown.
This commit is contained in:
Martin Kleusberg
2016-09-06 14:29:07 +02:00
parent ed914e0fb2
commit 4b79f92eaa

View File

@@ -221,12 +221,15 @@ QVariant SqliteTableModel::data(const QModelIndex &index, int role) const
const_cast<SqliteTableModel*>(this)->fetchMore(); // Nothing evil to see here, move along
if(role == Qt::DisplayRole && m_data.at(index.row()).at(index.column()).isNull())
{
return Settings::getSettingsValue("databrowser", "null_text").toString();
else if(role == Qt::DisplayRole && isBinary(index))
} else if(role == Qt::DisplayRole && isBinary(index)) {
return "BLOB";
else {
} else if(role == Qt::DisplayRole) {
int limit = Settings::getSettingsValue("databrowser", "symbol_limit").toInt();
return decode(m_data.at(index.row()).at(index.column()).left(limit));
} else {
return decode(m_data.at(index.row()).at(index.column()));
}
} else if(role == Qt::FontRole) {
QFont font;