File indexing completed on 2024-04-21 16:29:26

0001 /* generated by rust_qt_binding_generator */
0002 #ifndef TEST_TREE_RUST_H
0003 #define TEST_TREE_RUST_H
0004 
0005 #include <QtCore/QObject>
0006 #include <QtCore/QAbstractItemModel>
0007 
0008 class Persons;
0009 
0010 class Persons : public QAbstractItemModel
0011 {
0012     Q_OBJECT
0013 public:
0014     class Private;
0015 private:
0016     Private * m_d;
0017     bool m_ownsPrivate;
0018     explicit Persons(bool owned, QObject *parent);
0019 public:
0020     explicit Persons(QObject *parent = nullptr);
0021     ~Persons();
0022 
0023     int columnCount(const QModelIndex &parent = QModelIndex()) const override;
0024     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
0025     QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
0026     QModelIndex parent(const QModelIndex &index) const override;
0027     bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
0028     int rowCount(const QModelIndex &parent = QModelIndex()) const override;
0029     bool canFetchMore(const QModelIndex &parent) const override;
0030     void fetchMore(const QModelIndex &parent) override;
0031     Qt::ItemFlags flags(const QModelIndex &index) const override;
0032     void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
0033     int role(const char* name) const;
0034     QHash<int, QByteArray> roleNames() const override;
0035     QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
0036     bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole) override;
0037     Q_INVOKABLE bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
0038     Q_INVOKABLE bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
0039     bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
0040     Q_INVOKABLE QString userName(const QModelIndex& index) const;
0041     Q_INVOKABLE bool setUserName(const QModelIndex& index, const QString& value);
0042 
0043 Q_SIGNALS:
0044     // new data is ready to be made available to the model with fetchMore()
0045     void newDataReady(const QModelIndex &parent) const;
0046 private:
0047     QHash<QPair<int,Qt::ItemDataRole>, QVariant> m_headerData;
0048     void initHeaderData();
0049     void updatePersistentIndexes();
0050 Q_SIGNALS:
0051 };
0052 #endif // TEST_TREE_RUST_H