19 int count()
const override final;
20 bool isEmpty() const override final {
return count() == 0; }
21 void setDirty(
bool dirty)
override final;
22 void clear() override final;
23 QObject* removeOne(const QObject*
object) override final {
return removeAt(indexOf(
object)); }
24 bool contains(
const QObject*
object)
override final {
return _objectList.indexOf(
object) != -1; }
25 void clearAndDeleteContents() override final;
28 Q_INVOKABLE QObject* get(
int index);
29 QObject* operator[](
int index);
30 const QObject* operator[](
int index) const;
31 void append(QObject*
object);
32 void append(QList<QObject*> objects);
33 QObjectList swapObjectList(const QObjectList& newlist);
34 QObject* removeAt(
int index);
35 void insert(
int index, QObject*
object);
36 void insert(
int index, QList<QObject*> objects);
37 int indexOf(const QObject*
object) {
return _objectList.indexOf(
object); }
38 void move(
int from,
int to);
39 template<
class T> T
value(
int index)
const {
return qobject_cast<T>(_objectList[index]); }
44 int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
45 QVariant data(
const QModelIndex& index,
int role = Qt::DisplayRole)
const override;
46 bool insertRows(
int position,
int rows,
const QModelIndex& index = QModelIndex())
override;
47 bool removeRows(
int position,
int rows,
const QModelIndex& index = QModelIndex())
override;
48 bool setData(
const QModelIndex& index,
const QVariant& value,
int role = Qt::EditRole)
override;
51 QList<QObject*> _objectList;