QueryResultModel no longer truncates long strings to improve display performance.
Optimization of display is now done by PgLabItemDelegate. This also makes it easier in future commit to enabled showing complete string and correctly exporting the data.
This commit is contained in:
parent
be2ffd7ef9
commit
db735363f7
2 changed files with 9 additions and 19 deletions
|
|
@ -99,9 +99,14 @@ void PgLabItemDelegate::initStyleOption(QStyleOptionViewItem *option,
|
|||
option->palette.setBrush(QPalette::Text, QBrush(forground_color));
|
||||
|
||||
option->features |= QStyleOptionViewItem::HasDisplay;
|
||||
option->text = oid == Pgsql::bool_oid
|
||||
? FormatBoolForDisplay(value.toBool())
|
||||
: displayText(value, option->locale);
|
||||
if (oid == Pgsql::bool_oid)
|
||||
option->text = FormatBoolForDisplay(value.toBool());
|
||||
else {
|
||||
auto str = value.toString();
|
||||
auto s = str.leftRef(100);
|
||||
auto f = s.indexOf('\n');
|
||||
option->text = ((f > 0) ? s.left(f) : s).toString();
|
||||
}
|
||||
}
|
||||
else {
|
||||
option->palette.setBrush(QPalette::Text, QBrush(GetDefaultNullColor()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue