File indexing completed on 2025-02-02 15:50:27
0001 /* generated by rust_qt_binding_generator */ 0002 #ifndef TEST_LIST_RUST_H 0003 #define TEST_LIST_RUST_H 0004 0005 #include <QtCore/QObject> 0006 #include <QtCore/QAbstractItemModel> 0007 0008 class NoRole; 0009 class Persons; 0010 0011 class NoRole : public QAbstractItemModel 0012 { 0013 Q_OBJECT 0014 public: 0015 class Private; 0016 private: 0017 Private * m_d; 0018 bool m_ownsPrivate; 0019 explicit NoRole(bool owned, QObject *parent); 0020 public: 0021 explicit NoRole(QObject *parent = nullptr); 0022 ~NoRole(); 0023 0024 int columnCount(const QModelIndex &parent = QModelIndex()) const override; 0025 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; 0026 QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; 0027 QModelIndex parent(const QModelIndex &index) const override; 0028 bool hasChildren(const QModelIndex &parent = QModelIndex()) const override; 0029 int rowCount(const QModelIndex &parent = QModelIndex()) const override; 0030 bool canFetchMore(const QModelIndex &parent) const override; 0031 void fetchMore(const QModelIndex &parent) override; 0032 Qt::ItemFlags flags(const QModelIndex &index) const override; 0033 void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override; 0034 int role(const char* name) const; 0035 QHash<int, QByteArray> roleNames() const override; 0036 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; 0037 bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole) override; 0038 Q_INVOKABLE bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; 0039 Q_INVOKABLE bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; 0040 bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; 0041 Q_INVOKABLE quint8 userAge(int row) const; 0042 Q_INVOKABLE bool setUserAge(int row, quint8 value); 0043 Q_INVOKABLE QString userName(int row) const; 0044 Q_INVOKABLE bool setUserName(int row, const QString& value); 0045 0046 Q_SIGNALS: 0047 // new data is ready to be made available to the model with fetchMore() 0048 void newDataReady(const QModelIndex &parent) const; 0049 private: 0050 QHash<QPair<int,Qt::ItemDataRole>, QVariant> m_headerData; 0051 void initHeaderData(); 0052 void updatePersistentIndexes(); 0053 Q_SIGNALS: 0054 }; 0055 0056 class Persons : public QAbstractItemModel 0057 { 0058 Q_OBJECT 0059 public: 0060 class Private; 0061 private: 0062 Private * m_d; 0063 bool m_ownsPrivate; 0064 explicit Persons(bool owned, QObject *parent); 0065 public: 0066 explicit Persons(QObject *parent = nullptr); 0067 ~Persons(); 0068 0069 int columnCount(const QModelIndex &parent = QModelIndex()) const override; 0070 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; 0071 QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; 0072 QModelIndex parent(const QModelIndex &index) const override; 0073 bool hasChildren(const QModelIndex &parent = QModelIndex()) const override; 0074 int rowCount(const QModelIndex &parent = QModelIndex()) const override; 0075 bool canFetchMore(const QModelIndex &parent) const override; 0076 void fetchMore(const QModelIndex &parent) override; 0077 Qt::ItemFlags flags(const QModelIndex &index) const override; 0078 void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override; 0079 int role(const char* name) const; 0080 QHash<int, QByteArray> roleNames() const override; 0081 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; 0082 bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole) override; 0083 Q_INVOKABLE bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; 0084 Q_INVOKABLE bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; 0085 bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; 0086 Q_INVOKABLE QString userName(int row) const; 0087 Q_INVOKABLE bool setUserName(int row, const QString& value); 0088 0089 Q_SIGNALS: 0090 // new data is ready to be made available to the model with fetchMore() 0091 void newDataReady(const QModelIndex &parent) const; 0092 private: 0093 QHash<QPair<int,Qt::ItemDataRole>, QVariant> m_headerData; 0094 void initHeaderData(); 0095 void updatePersistentIndexes(); 0096 Q_SIGNALS: 0097 }; 0098 #endif // TEST_LIST_RUST_H