2017-08-20 07:11:58 -07:00
|
|
|
/* generated by rust_qt_binding_generator */
|
|
|
|
#ifndef TEST_LIST_RUST_H
|
|
|
|
#define TEST_LIST_RUST_H
|
|
|
|
|
2018-09-28 13:36:56 -07:00
|
|
|
#include <QtCore/QObject>
|
|
|
|
#include <QtCore/QAbstractItemModel>
|
2017-08-20 07:11:58 -07:00
|
|
|
|
2018-05-19 05:01:11 -07:00
|
|
|
class NoRole;
|
2017-08-28 00:28:48 -07:00
|
|
|
class Persons;
|
|
|
|
|
2018-05-19 05:01:11 -07:00
|
|
|
class NoRole : public QAbstractItemModel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
class Private;
|
|
|
|
private:
|
|
|
|
Private * m_d;
|
|
|
|
bool m_ownsPrivate;
|
|
|
|
explicit NoRole(bool owned, QObject *parent);
|
|
|
|
public:
|
|
|
|
explicit NoRole(QObject *parent = nullptr);
|
|
|
|
~NoRole();
|
|
|
|
|
|
|
|
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
|
|
|
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
QModelIndex parent(const QModelIndex &index) const override;
|
|
|
|
bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
bool canFetchMore(const QModelIndex &parent) const override;
|
|
|
|
void fetchMore(const QModelIndex &parent) override;
|
|
|
|
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
|
|
|
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
|
2018-05-19 08:08:18 -07:00
|
|
|
int role(const char* name) const;
|
2018-05-19 05:01:11 -07:00
|
|
|
QHash<int, QByteArray> roleNames() const override;
|
|
|
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
|
|
|
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole) override;
|
|
|
|
Q_INVOKABLE bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
|
|
|
|
Q_INVOKABLE bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
|
|
|
|
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
|
|
|
|
Q_INVOKABLE quint8 userAge(int row) const;
|
|
|
|
Q_INVOKABLE bool setUserAge(int row, quint8 value);
|
|
|
|
Q_INVOKABLE QString userName(int row) const;
|
|
|
|
Q_INVOKABLE bool setUserName(int row, const QString& value);
|
|
|
|
|
2018-09-15 16:36:14 -07:00
|
|
|
Q_SIGNALS:
|
2018-05-19 05:01:11 -07:00
|
|
|
// new data is ready to be made available to the model with fetchMore()
|
|
|
|
void newDataReady(const QModelIndex &parent) const;
|
|
|
|
private:
|
|
|
|
QHash<QPair<int,Qt::ItemDataRole>, QVariant> m_headerData;
|
|
|
|
void initHeaderData();
|
2018-09-11 14:06:52 -07:00
|
|
|
void updatePersistentIndexes();
|
2018-09-15 16:36:14 -07:00
|
|
|
Q_SIGNALS:
|
2018-05-19 05:01:11 -07:00
|
|
|
};
|
|
|
|
|
2017-08-20 07:11:58 -07:00
|
|
|
class Persons : public QAbstractItemModel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
class Private;
|
|
|
|
private:
|
2017-08-26 10:10:18 -07:00
|
|
|
Private * m_d;
|
|
|
|
bool m_ownsPrivate;
|
|
|
|
explicit Persons(bool owned, QObject *parent);
|
2017-08-20 07:11:58 -07:00
|
|
|
public:
|
|
|
|
explicit Persons(QObject *parent = nullptr);
|
|
|
|
~Persons();
|
|
|
|
|
|
|
|
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
|
|
|
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
QModelIndex parent(const QModelIndex &index) const override;
|
|
|
|
bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
bool canFetchMore(const QModelIndex &parent) const override;
|
|
|
|
void fetchMore(const QModelIndex &parent) override;
|
|
|
|
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
|
|
|
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
|
2018-05-19 08:08:18 -07:00
|
|
|
int role(const char* name) const;
|
2017-08-20 07:11:58 -07:00
|
|
|
QHash<int, QByteArray> roleNames() const override;
|
2017-09-01 11:36:59 -07:00
|
|
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
|
|
|
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole) override;
|
2017-10-02 15:34:44 -07:00
|
|
|
Q_INVOKABLE bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
|
2017-10-03 11:22:44 -07:00
|
|
|
Q_INVOKABLE bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
|
2017-09-01 03:03:40 -07:00
|
|
|
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
|
2018-05-16 00:12:03 -07:00
|
|
|
Q_INVOKABLE QString userName(int row) const;
|
|
|
|
Q_INVOKABLE bool setUserName(int row, const QString& value);
|
2017-09-01 02:57:10 -07:00
|
|
|
|
2018-09-15 16:36:14 -07:00
|
|
|
Q_SIGNALS:
|
2017-08-20 07:11:58 -07:00
|
|
|
// new data is ready to be made available to the model with fetchMore()
|
|
|
|
void newDataReady(const QModelIndex &parent) const;
|
2017-08-31 10:20:25 -07:00
|
|
|
private:
|
|
|
|
QHash<QPair<int,Qt::ItemDataRole>, QVariant> m_headerData;
|
|
|
|
void initHeaderData();
|
2018-09-11 14:06:52 -07:00
|
|
|
void updatePersistentIndexes();
|
2018-09-15 16:36:14 -07:00
|
|
|
Q_SIGNALS:
|
2017-08-20 07:11:58 -07:00
|
|
|
};
|
|
|
|
#endif // TEST_LIST_RUST_H
|