##// END OF EJS Templates
Adds "unit" and "mission" columns to variable widget
Alexandre Leroux -
r519:873e4c155e63
parent child
Show More
@@ -16,7 +16,9 namespace {
16 16 const auto NAME_COLUMN = 0;
17 17 const auto TSTART_COLUMN = 1;
18 18 const auto TEND_COLUMN = 2;
19 const auto NB_COLUMNS = 3;
19 const auto UNIT_COLUMN = 3;
20 const auto MISSION_COLUMN = 4;
21 const auto NB_COLUMNS = 5;
20 22
21 23 // Column properties
22 24 const auto DEFAULT_HEIGHT = 25;
@@ -34,10 +36,10 struct ColumnProperties {
34 36 int m_Height;
35 37 };
36 38
37 const auto COLUMN_PROPERTIES
38 = QHash<int, ColumnProperties>{{NAME_COLUMN, {QObject::tr("Name")}},
39 {TSTART_COLUMN, {QObject::tr("tStart"), 180}},
40 {TEND_COLUMN, {QObject::tr("tEnd"), 180}}};
39 const auto COLUMN_PROPERTIES = QHash<int, ColumnProperties>{
40 {NAME_COLUMN, {QObject::tr("Name")}}, {TSTART_COLUMN, {QObject::tr("tStart"), 180}},
41 {TEND_COLUMN, {QObject::tr("tEnd"), 180}}, {UNIT_COLUMN, {QObject::tr("Unit")}},
42 {MISSION_COLUMN, {QObject::tr("Mission")}}};
41 43
42 44 /// Format for datetimes
43 45 const auto DATETIME_FORMAT = QStringLiteral("dd/MM/yyyy \nhh:mm:ss:zzz");
@@ -163,6 +165,10 QVariant VariableModel::data(const QModelIndex &index, int role) const
163 165 return dateTimeVariant(variable->range().m_TStart);
164 166 case TEND_COLUMN:
165 167 return dateTimeVariant(variable->range().m_TEnd);
168 case UNIT_COLUMN:
169 return variable->metadata().value(QStringLiteral("units"));
170 case MISSION_COLUMN:
171 return variable->metadata().value(QStringLiteral("mission"));
166 172 default:
167 173 // No action
168 174 break;
General Comments 0
You need to be logged in to leave comments. Login now