File indexing completed on 2024-04-21 05:44:57

0001 /* generated by rust_qt_binding_generator */
0002 #include "test_list_types_rust.h"
0003 
0004 namespace {
0005 
0006     struct option_bool {
0007     public:
0008         bool value;
0009         bool some;
0010         operator QVariant() const {
0011             if (some) {
0012                 return QVariant::fromValue(value);
0013             }
0014             return QVariant();
0015         }
0016     };
0017     static_assert(std::is_pod<option_bool>::value, "option_bool must be a POD type.");
0018 
0019     struct option_quintptr {
0020     public:
0021         quintptr value;
0022         bool some;
0023         operator QVariant() const {
0024             if (some) {
0025                 return QVariant::fromValue(value);
0026             }
0027             return QVariant();
0028         }
0029     };
0030     static_assert(std::is_pod<option_quintptr>::value, "option_quintptr must be a POD type.");
0031 
0032     typedef void (*qstring_set)(QString* val, const char* utf8, int nbytes);
0033     void set_qstring(QString* val, const char* utf8, int nbytes) {
0034         *val = QString::fromUtf8(utf8, nbytes);
0035     }
0036 
0037     typedef void (*qbytearray_set)(QByteArray* val, const char* bytes, int nbytes);
0038     void set_qbytearray(QByteArray* v, const char* bytes, int nbytes) {
0039         if (v->isNull() && nbytes == 0) {
0040             *v = QByteArray(bytes, nbytes);
0041         } else {
0042             v->truncate(0);
0043             v->append(bytes, nbytes);
0044         }
0045     }
0046 
0047     struct qmodelindex_t {
0048         int row;
0049         quintptr id;
0050     };
0051     inline QVariant cleanNullQVariant(const QVariant& v) {
0052         return (v.isNull()) ?QVariant() :v;
0053     }
0054 }
0055 extern "C" {
0056     bool list_data_boolean(const List::Private*, int);
0057     bool list_set_data_boolean(List::Private*, int, bool);
0058     void list_data_bytearray(const List::Private*, int, QByteArray*, qbytearray_set);
0059     bool list_set_data_bytearray(List::Private*, int, const char* s, int len);
0060     float list_data_f32(const List::Private*, int);
0061     bool list_set_data_f32(List::Private*, int, float);
0062     double list_data_f64(const List::Private*, int);
0063     bool list_set_data_f64(List::Private*, int, double);
0064     qint16 list_data_i16(const List::Private*, int);
0065     bool list_set_data_i16(List::Private*, int, qint16);
0066     qint32 list_data_i32(const List::Private*, int);
0067     bool list_set_data_i32(List::Private*, int, qint32);
0068     qint64 list_data_i64(const List::Private*, int);
0069     bool list_set_data_i64(List::Private*, int, qint64);
0070     qint8 list_data_i8(const List::Private*, int);
0071     bool list_set_data_i8(List::Private*, int, qint8);
0072     option_bool list_data_optional_boolean(const List::Private*, int);
0073     bool list_set_data_optional_boolean(List::Private*, int, bool);
0074     bool list_set_data_optional_boolean_none(List::Private*, int);
0075     void list_data_optional_bytearray(const List::Private*, int, QByteArray*, qbytearray_set);
0076     bool list_set_data_optional_bytearray(List::Private*, int, const char* s, int len);
0077     bool list_set_data_optional_bytearray_none(List::Private*, int);
0078     void list_data_optional_string(const List::Private*, int, QString*, qstring_set);
0079     bool list_set_data_optional_string(List::Private*, int, const ushort* s, int len);
0080     bool list_set_data_optional_string_none(List::Private*, int);
0081     void list_data_string(const List::Private*, int, QString*, qstring_set);
0082     bool list_set_data_string(List::Private*, int, const ushort* s, int len);
0083     quint16 list_data_u16(const List::Private*, int);
0084     bool list_set_data_u16(List::Private*, int, quint16);
0085     quint32 list_data_u32(const List::Private*, int);
0086     bool list_set_data_u32(List::Private*, int, quint32);
0087     quint64 list_data_u64(const List::Private*, int);
0088     bool list_set_data_u64(List::Private*, int, quint64);
0089     quint8 list_data_u8(const List::Private*, int);
0090     bool list_set_data_u8(List::Private*, int, quint8);
0091     void list_sort(List::Private*, unsigned char column, Qt::SortOrder order = Qt::AscendingOrder);
0092 
0093     int list_row_count(const List::Private*);
0094     bool list_insert_rows(List::Private*, int, int);
0095     bool list_remove_rows(List::Private*, int, int);
0096     bool list_can_fetch_more(const List::Private*);
0097     void list_fetch_more(List::Private*);
0098 }
0099 int List::columnCount(const QModelIndex &parent) const
0100 {
0101     return (parent.isValid()) ? 0 : 1;
0102 }
0103 
0104 bool List::hasChildren(const QModelIndex &parent) const
0105 {
0106     return rowCount(parent) > 0;
0107 }
0108 
0109 int List::rowCount(const QModelIndex &parent) const
0110 {
0111     return (parent.isValid()) ? 0 : list_row_count(m_d);
0112 }
0113 
0114 bool List::insertRows(int row, int count, const QModelIndex &)
0115 {
0116     return list_insert_rows(m_d, row, count);
0117 }
0118 
0119 bool List::removeRows(int row, int count, const QModelIndex &)
0120 {
0121     return list_remove_rows(m_d, row, count);
0122 }
0123 
0124 QModelIndex List::index(int row, int column, const QModelIndex &parent) const
0125 {
0126     if (!parent.isValid() && row >= 0 && row < rowCount(parent) && column >= 0 && column < 1) {
0127         return createIndex(row, column, (quintptr)row);
0128     }
0129     return QModelIndex();
0130 }
0131 
0132 QModelIndex List::parent(const QModelIndex &) const
0133 {
0134     return QModelIndex();
0135 }
0136 
0137 bool List::canFetchMore(const QModelIndex &parent) const
0138 {
0139     return (parent.isValid()) ? 0 : list_can_fetch_more(m_d);
0140 }
0141 
0142 void List::fetchMore(const QModelIndex &parent)
0143 {
0144     if (!parent.isValid()) {
0145         list_fetch_more(m_d);
0146     }
0147 }
0148 void List::updatePersistentIndexes() {}
0149 
0150 void List::sort(int column, Qt::SortOrder order)
0151 {
0152     list_sort(m_d, column, order);
0153 }
0154 Qt::ItemFlags List::flags(const QModelIndex &i) const
0155 {
0156     auto flags = QAbstractItemModel::flags(i);
0157     if (i.column() == 0) {
0158         flags |= Qt::ItemIsEditable;
0159     }
0160     return flags;
0161 }
0162 
0163 bool List::boolean(int row) const
0164 {
0165     return list_data_boolean(m_d, row);
0166 }
0167 
0168 bool List::setBoolean(int row, bool value)
0169 {
0170     bool set = false;
0171     set = list_set_data_boolean(m_d, row, value);
0172     if (set) {
0173         QModelIndex index = createIndex(row, 0, row);
0174         Q_EMIT dataChanged(index, index);
0175     }
0176     return set;
0177 }
0178 
0179 QByteArray List::bytearray(int row) const
0180 {
0181     QByteArray b;
0182     list_data_bytearray(m_d, row, &b, set_qbytearray);
0183     return b;
0184 }
0185 
0186 bool List::setBytearray(int row, const QByteArray& value)
0187 {
0188     bool set = false;
0189     set = list_set_data_bytearray(m_d, row, value.data(), value.length());
0190     if (set) {
0191         QModelIndex index = createIndex(row, 0, row);
0192         Q_EMIT dataChanged(index, index);
0193     }
0194     return set;
0195 }
0196 
0197 float List::f32(int row) const
0198 {
0199     return list_data_f32(m_d, row);
0200 }
0201 
0202 bool List::setF32(int row, float value)
0203 {
0204     bool set = false;
0205     set = list_set_data_f32(m_d, row, value);
0206     if (set) {
0207         QModelIndex index = createIndex(row, 0, row);
0208         Q_EMIT dataChanged(index, index);
0209     }
0210     return set;
0211 }
0212 
0213 double List::f64(int row) const
0214 {
0215     return list_data_f64(m_d, row);
0216 }
0217 
0218 bool List::setF64(int row, double value)
0219 {
0220     bool set = false;
0221     set = list_set_data_f64(m_d, row, value);
0222     if (set) {
0223         QModelIndex index = createIndex(row, 0, row);
0224         Q_EMIT dataChanged(index, index);
0225     }
0226     return set;
0227 }
0228 
0229 qint16 List::i16(int row) const
0230 {
0231     return list_data_i16(m_d, row);
0232 }
0233 
0234 bool List::setI16(int row, qint16 value)
0235 {
0236     bool set = false;
0237     set = list_set_data_i16(m_d, row, value);
0238     if (set) {
0239         QModelIndex index = createIndex(row, 0, row);
0240         Q_EMIT dataChanged(index, index);
0241     }
0242     return set;
0243 }
0244 
0245 qint32 List::i32(int row) const
0246 {
0247     return list_data_i32(m_d, row);
0248 }
0249 
0250 bool List::setI32(int row, qint32 value)
0251 {
0252     bool set = false;
0253     set = list_set_data_i32(m_d, row, value);
0254     if (set) {
0255         QModelIndex index = createIndex(row, 0, row);
0256         Q_EMIT dataChanged(index, index);
0257     }
0258     return set;
0259 }
0260 
0261 qint64 List::i64(int row) const
0262 {
0263     return list_data_i64(m_d, row);
0264 }
0265 
0266 bool List::setI64(int row, qint64 value)
0267 {
0268     bool set = false;
0269     set = list_set_data_i64(m_d, row, value);
0270     if (set) {
0271         QModelIndex index = createIndex(row, 0, row);
0272         Q_EMIT dataChanged(index, index);
0273     }
0274     return set;
0275 }
0276 
0277 qint8 List::i8(int row) const
0278 {
0279     return list_data_i8(m_d, row);
0280 }
0281 
0282 bool List::setI8(int row, qint8 value)
0283 {
0284     bool set = false;
0285     set = list_set_data_i8(m_d, row, value);
0286     if (set) {
0287         QModelIndex index = createIndex(row, 0, row);
0288         Q_EMIT dataChanged(index, index);
0289     }
0290     return set;
0291 }
0292 
0293 QVariant List::optionalBoolean(int row) const
0294 {
0295     QVariant v;
0296     v = list_data_optional_boolean(m_d, row);
0297     return v;
0298 }
0299 
0300 bool List::setOptionalBoolean(int row, const QVariant& value)
0301 {
0302     bool set = false;
0303     if (value.isNull() || !value.isValid()) {
0304         set = list_set_data_optional_boolean_none(m_d, row);
0305     } else {
0306     if (!value.canConvert(qMetaTypeId<bool>())) {
0307         return false;
0308     }
0309     set = list_set_data_optional_boolean(m_d, row, value.value<bool>());
0310     }
0311     if (set) {
0312         QModelIndex index = createIndex(row, 0, row);
0313         Q_EMIT dataChanged(index, index);
0314     }
0315     return set;
0316 }
0317 
0318 QByteArray List::optionalBytearray(int row) const
0319 {
0320     QByteArray b;
0321     list_data_optional_bytearray(m_d, row, &b, set_qbytearray);
0322     return b;
0323 }
0324 
0325 bool List::setOptionalBytearray(int row, const QByteArray& value)
0326 {
0327     bool set = false;
0328     if (value.isNull()) {
0329         set = list_set_data_optional_bytearray_none(m_d, row);
0330     } else {
0331     set = list_set_data_optional_bytearray(m_d, row, value.data(), value.length());
0332     }
0333     if (set) {
0334         QModelIndex index = createIndex(row, 0, row);
0335         Q_EMIT dataChanged(index, index);
0336     }
0337     return set;
0338 }
0339 
0340 QString List::optionalString(int row) const
0341 {
0342     QString s;
0343     list_data_optional_string(m_d, row, &s, set_qstring);
0344     return s;
0345 }
0346 
0347 bool List::setOptionalString(int row, const QString& value)
0348 {
0349     bool set = false;
0350     if (value.isNull()) {
0351         set = list_set_data_optional_string_none(m_d, row);
0352     } else {
0353     set = list_set_data_optional_string(m_d, row, value.utf16(), value.length());
0354     }
0355     if (set) {
0356         QModelIndex index = createIndex(row, 0, row);
0357         Q_EMIT dataChanged(index, index);
0358     }
0359     return set;
0360 }
0361 
0362 QString List::string(int row) const
0363 {
0364     QString s;
0365     list_data_string(m_d, row, &s, set_qstring);
0366     return s;
0367 }
0368 
0369 bool List::setString(int row, const QString& value)
0370 {
0371     bool set = false;
0372     set = list_set_data_string(m_d, row, value.utf16(), value.length());
0373     if (set) {
0374         QModelIndex index = createIndex(row, 0, row);
0375         Q_EMIT dataChanged(index, index);
0376     }
0377     return set;
0378 }
0379 
0380 quint16 List::u16(int row) const
0381 {
0382     return list_data_u16(m_d, row);
0383 }
0384 
0385 bool List::setU16(int row, quint16 value)
0386 {
0387     bool set = false;
0388     set = list_set_data_u16(m_d, row, value);
0389     if (set) {
0390         QModelIndex index = createIndex(row, 0, row);
0391         Q_EMIT dataChanged(index, index);
0392     }
0393     return set;
0394 }
0395 
0396 quint32 List::u32(int row) const
0397 {
0398     return list_data_u32(m_d, row);
0399 }
0400 
0401 bool List::setU32(int row, quint32 value)
0402 {
0403     bool set = false;
0404     set = list_set_data_u32(m_d, row, value);
0405     if (set) {
0406         QModelIndex index = createIndex(row, 0, row);
0407         Q_EMIT dataChanged(index, index);
0408     }
0409     return set;
0410 }
0411 
0412 quint64 List::u64(int row) const
0413 {
0414     return list_data_u64(m_d, row);
0415 }
0416 
0417 bool List::setU64(int row, quint64 value)
0418 {
0419     bool set = false;
0420     set = list_set_data_u64(m_d, row, value);
0421     if (set) {
0422         QModelIndex index = createIndex(row, 0, row);
0423         Q_EMIT dataChanged(index, index);
0424     }
0425     return set;
0426 }
0427 
0428 quint8 List::u8(int row) const
0429 {
0430     return list_data_u8(m_d, row);
0431 }
0432 
0433 bool List::setU8(int row, quint8 value)
0434 {
0435     bool set = false;
0436     set = list_set_data_u8(m_d, row, value);
0437     if (set) {
0438         QModelIndex index = createIndex(row, 0, row);
0439         Q_EMIT dataChanged(index, index);
0440     }
0441     return set;
0442 }
0443 
0444 QVariant List::data(const QModelIndex &index, int role) const
0445 {
0446     Q_ASSERT(rowCount(index.parent()) > index.row());
0447     switch (index.column()) {
0448     case 0:
0449         switch (role) {
0450         case Qt::UserRole + 0:
0451             return QVariant::fromValue(boolean(index.row()));
0452         case Qt::UserRole + 1:
0453             return QVariant::fromValue(bytearray(index.row()));
0454         case Qt::UserRole + 2:
0455             return QVariant::fromValue(f32(index.row()));
0456         case Qt::UserRole + 3:
0457             return QVariant::fromValue(f64(index.row()));
0458         case Qt::UserRole + 4:
0459             return QVariant::fromValue(i16(index.row()));
0460         case Qt::UserRole + 5:
0461             return QVariant::fromValue(i32(index.row()));
0462         case Qt::UserRole + 6:
0463             return QVariant::fromValue(i64(index.row()));
0464         case Qt::UserRole + 7:
0465             return QVariant::fromValue(i8(index.row()));
0466         case Qt::UserRole + 8:
0467             return optionalBoolean(index.row());
0468         case Qt::UserRole + 9:
0469             return cleanNullQVariant(QVariant::fromValue(optionalBytearray(index.row())));
0470         case Qt::UserRole + 10:
0471             return cleanNullQVariant(QVariant::fromValue(optionalString(index.row())));
0472         case Qt::DisplayRole:
0473         case Qt::EditRole:
0474         case Qt::UserRole + 11:
0475             return QVariant::fromValue(string(index.row()));
0476         case Qt::UserRole + 12:
0477             return QVariant::fromValue(u16(index.row()));
0478         case Qt::UserRole + 13:
0479             return QVariant::fromValue(u32(index.row()));
0480         case Qt::UserRole + 14:
0481             return QVariant::fromValue(u64(index.row()));
0482         case Qt::UserRole + 15:
0483             return QVariant::fromValue(u8(index.row()));
0484         }
0485         break;
0486     }
0487     return QVariant();
0488 }
0489 
0490 int List::role(const char* name) const {
0491     auto names = roleNames();
0492     auto i = names.constBegin();
0493     while (i != names.constEnd()) {
0494         if (i.value() == name) {
0495             return i.key();
0496         }
0497         ++i;
0498     }
0499     return -1;
0500 }
0501 QHash<int, QByteArray> List::roleNames() const {
0502     QHash<int, QByteArray> names = QAbstractItemModel::roleNames();
0503     names.insert(Qt::UserRole + 0, "boolean");
0504     names.insert(Qt::UserRole + 1, "bytearray");
0505     names.insert(Qt::UserRole + 2, "f32");
0506     names.insert(Qt::UserRole + 3, "f64");
0507     names.insert(Qt::UserRole + 4, "i16");
0508     names.insert(Qt::UserRole + 5, "i32");
0509     names.insert(Qt::UserRole + 6, "i64");
0510     names.insert(Qt::UserRole + 7, "i8");
0511     names.insert(Qt::UserRole + 8, "optionalBoolean");
0512     names.insert(Qt::UserRole + 9, "optionalBytearray");
0513     names.insert(Qt::UserRole + 10, "optionalString");
0514     names.insert(Qt::UserRole + 11, "string");
0515     names.insert(Qt::UserRole + 12, "u16");
0516     names.insert(Qt::UserRole + 13, "u32");
0517     names.insert(Qt::UserRole + 14, "u64");
0518     names.insert(Qt::UserRole + 15, "u8");
0519     return names;
0520 }
0521 QVariant List::headerData(int section, Qt::Orientation orientation, int role) const
0522 {
0523     if (orientation != Qt::Horizontal) {
0524         return QVariant();
0525     }
0526     return m_headerData.value(qMakePair(section, (Qt::ItemDataRole)role), role == Qt::DisplayRole ?QString::number(section + 1) :QVariant());
0527 }
0528 
0529 bool List::setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role)
0530 {
0531     if (orientation != Qt::Horizontal) {
0532         return false;
0533     }
0534     m_headerData.insert(qMakePair(section, (Qt::ItemDataRole)role), value);
0535     return true;
0536 }
0537 
0538 bool List::setData(const QModelIndex &index, const QVariant &value, int role)
0539 {
0540     if (index.column() == 0) {
0541         if (role == Qt::UserRole + 0) {
0542             if (value.canConvert(qMetaTypeId<bool>())) {
0543                 return setBoolean(index.row(), value.value<bool>());
0544             }
0545         }
0546         if (role == Qt::UserRole + 1) {
0547             if (value.canConvert(qMetaTypeId<QByteArray>())) {
0548                 return setBytearray(index.row(), value.value<QByteArray>());
0549             }
0550         }
0551         if (role == Qt::UserRole + 2) {
0552             if (value.canConvert(qMetaTypeId<float>())) {
0553                 return setF32(index.row(), value.value<float>());
0554             }
0555         }
0556         if (role == Qt::UserRole + 3) {
0557             if (value.canConvert(qMetaTypeId<double>())) {
0558                 return setF64(index.row(), value.value<double>());
0559             }
0560         }
0561         if (role == Qt::UserRole + 4) {
0562             if (value.canConvert(qMetaTypeId<qint16>())) {
0563                 return setI16(index.row(), value.value<qint16>());
0564             }
0565         }
0566         if (role == Qt::UserRole + 5) {
0567             if (value.canConvert(qMetaTypeId<qint32>())) {
0568                 return setI32(index.row(), value.value<qint32>());
0569             }
0570         }
0571         if (role == Qt::UserRole + 6) {
0572             if (value.canConvert(qMetaTypeId<qint64>())) {
0573                 return setI64(index.row(), value.value<qint64>());
0574             }
0575         }
0576         if (role == Qt::UserRole + 7) {
0577             if (value.canConvert(qMetaTypeId<qint8>())) {
0578                 return setI8(index.row(), value.value<qint8>());
0579             }
0580         }
0581         if (role == Qt::UserRole + 8) {
0582             return setOptionalBoolean(index.row(), value);
0583         }
0584         if (role == Qt::UserRole + 9) {
0585             if (!value.isValid() || value.isNull() ||value.canConvert(qMetaTypeId<QByteArray>())) {
0586                 return setOptionalBytearray(index.row(), value.value<QByteArray>());
0587             }
0588         }
0589         if (role == Qt::UserRole + 10) {
0590             if (!value.isValid() || value.isNull() ||value.canConvert(qMetaTypeId<QString>())) {
0591                 return setOptionalString(index.row(), value.value<QString>());
0592             }
0593         }
0594         if (role == Qt::DisplayRole || role == Qt::EditRole || role == Qt::UserRole + 11) {
0595             if (value.canConvert(qMetaTypeId<QString>())) {
0596                 return setString(index.row(), value.value<QString>());
0597             }
0598         }
0599         if (role == Qt::UserRole + 12) {
0600             if (value.canConvert(qMetaTypeId<quint16>())) {
0601                 return setU16(index.row(), value.value<quint16>());
0602             }
0603         }
0604         if (role == Qt::UserRole + 13) {
0605             if (value.canConvert(qMetaTypeId<quint32>())) {
0606                 return setU32(index.row(), value.value<quint32>());
0607             }
0608         }
0609         if (role == Qt::UserRole + 14) {
0610             if (value.canConvert(qMetaTypeId<quint64>())) {
0611                 return setU64(index.row(), value.value<quint64>());
0612             }
0613         }
0614         if (role == Qt::UserRole + 15) {
0615             if (value.canConvert(qMetaTypeId<quint8>())) {
0616                 return setU8(index.row(), value.value<quint8>());
0617             }
0618         }
0619     }
0620     return false;
0621 }
0622 
0623 extern "C" {
0624     List::Private* list_new(List*,
0625         void (*)(const List*),
0626         void (*)(List*),
0627         void (*)(List*),
0628         void (*)(List*, quintptr, quintptr),
0629         void (*)(List*),
0630         void (*)(List*),
0631         void (*)(List*, int, int),
0632         void (*)(List*),
0633         void (*)(List*, int, int, int),
0634         void (*)(List*),
0635         void (*)(List*, int, int),
0636         void (*)(List*));
0637     void list_free(List::Private*);
0638 };
0639 
0640 List::List(bool /*owned*/, QObject *parent):
0641     QAbstractItemModel(parent),
0642     m_d(nullptr),
0643     m_ownsPrivate(false)
0644 {
0645     initHeaderData();
0646 }
0647 
0648 List::List(QObject *parent):
0649     QAbstractItemModel(parent),
0650     m_d(list_new(this,
0651         [](const List* o) {
0652             Q_EMIT o->newDataReady(QModelIndex());
0653         },
0654         [](List* o) {
0655             Q_EMIT o->layoutAboutToBeChanged();
0656         },
0657         [](List* o) {
0658             o->updatePersistentIndexes();
0659             Q_EMIT o->layoutChanged();
0660         },
0661         [](List* o, quintptr first, quintptr last) {
0662             o->dataChanged(o->createIndex(first, 0, first),
0663                        o->createIndex(last, 0, last));
0664         },
0665         [](List* o) {
0666             o->beginResetModel();
0667         },
0668         [](List* o) {
0669             o->endResetModel();
0670         },
0671         [](List* o, int first, int last) {
0672             o->beginInsertRows(QModelIndex(), first, last);
0673         },
0674         [](List* o) {
0675             o->endInsertRows();
0676         },
0677         [](List* o, int first, int last, int destination) {
0678             o->beginMoveRows(QModelIndex(), first, last, QModelIndex(), destination);
0679         },
0680         [](List* o) {
0681             o->endMoveRows();
0682         },
0683         [](List* o, int first, int last) {
0684             o->beginRemoveRows(QModelIndex(), first, last);
0685         },
0686         [](List* o) {
0687             o->endRemoveRows();
0688         }
0689 )),
0690     m_ownsPrivate(true)
0691 {
0692     connect(this, &List::newDataReady, this, [this](const QModelIndex& i) {
0693         this->fetchMore(i);
0694     }, Qt::QueuedConnection);
0695     initHeaderData();
0696 }
0697 
0698 List::~List() {
0699     if (m_ownsPrivate) {
0700         list_free(m_d);
0701     }
0702 }
0703 void List::initHeaderData() {
0704     m_headerData.insert(qMakePair(0, Qt::DisplayRole), QVariant("string"));
0705 }