Base: Quantity: return std::string
This commit is contained in:
committed by
Yorik van Havre
parent
9f7218ac75
commit
0b3adee2ab
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user