Base: Quantity: return std::string
This commit is contained in:
committed by
Yorik van Havre
parent
c11b37e312
commit
2ea8a633ac
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user