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 c11b37e312
commit 2ea8a633ac
58 changed files with 573 additions and 592 deletions

View File

@@ -103,15 +103,13 @@ void BaseDelegate::paintQuantity(QPainter* painter,
painter->drawText(option.rect, 0, QString());
}
else {
QString text;
QVariant item = getValue(index);
auto quantity = item.value<Base::Quantity>();
if (quantity.isValid()) {
QString text = quantity.getUserString();
painter->drawText(option.rect, 0, text);
}
else {
painter->drawText(option.rect, 0, QString());
text = QString::fromStdString(quantity.getUserString());
}
painter->drawText(option.rect, 0, text);
}
painter->restore();