--- a/src/RelpipeTableModel.h Tue Oct 09 23:22:05 2018 +0200
+++ b/src/RelpipeTableModel.h Wed Oct 10 00:01:48 2018 +0200
@@ -72,7 +72,22 @@
int column = attributeCounter % columnCount();
int row = attributeCounter / columnCount();
if (row >= records.size()) records.append(new QVector<QVariant>(columnCount()));
- setData(index(row, column), QString::fromWCharArray(value.c_str()));
+
+ QString valueString = QString::fromWCharArray(value.c_str());
+ QVariant valueVariant;
+ boolean_t conversionOk = false;
+ if (attributes[column].getTypeId() == TypeId::INTEGER) {
+ valueVariant = valueString.toUInt(&conversionOk);
+ }
+ // TODO: boolean → checkboxes
+ // else if (attributes[column].getTypeId() == TypeId::BOOLEAN) {
+ // valueVariant = L"true" == value;
+ // conversionOk = true;
+ // }
+
+ if (!conversionOk) valueVariant = valueString;
+
+ setData(index(row, column), valueVariant);
if (column == 0) emit layoutChanged(); // FIXME: emit other signal ~ begin..., end..., rowsInserted(??? index(0,0), row, row);
attributeCounter++;
}