Base: Quantity: return std::string

This commit is contained in:
Ladislav Michl
2024-07-13 13:07:27 +02:00
committed by Yorik van Havre
parent 9f7218ac75
commit 0b3adee2ab
58 changed files with 573 additions and 592 deletions

View File

@@ -72,16 +72,13 @@ void ArrayDelegate::paint(QPainter* painter,
auto* tableModel = dynamic_cast<const AbstractArrayModel*>(index.model());
painter->save();
if (tableModel->newRow(index)) {
painter->drawText(option.rect, 0, QString());
}
else {
QString text;
if (!tableModel->newRow(index)) {
QVariant item = tableModel->data(index);
auto quantity = item.value<Base::Quantity>();
QString text = quantity.getUserString();
painter->drawText(option.rect, 0, text);
text = QString::fromStdString(quantity.getUserString());
}
painter->drawText(option.rect, 0, text);
painter->restore();
}
else {