5 class OrmRecord : protected QSqlRecord
8 static QString colName(int col);
11 QVariant value(int col) const;
12 void setValue(int col, QVariant value);
16 QString OrmRecord<T>::colName(int col)
18 return T::sColNames.at(col);
22 QVariant OrmRecord<T>::value(int col) const
24 Q_ASSERT(col >= 0 && col < T::sColNames.count());
26 return QSqlRecord::value(T::sColNames.at(col));
30 void OrmRecord<T>::setValue(int col, QVariant value)
32 Q_ASSERT(col >= 0 && col < T::sColNames.count());
34 QString fieldName = T::sColNames.at(col);
36 if (!contains(fieldName))
38 append(QSqlField(fieldName, value.type()));
41 QSqlRecord::setValue(fieldName, value);