*****************************************/
class AbstractTreeItem : public QObject {
Q_OBJECT
- Q_PROPERTY(uint id READ id)
+ Q_PROPERTY(quint64 id READ id)
public:
AbstractTreeItem(AbstractTreeItem *parent = 0);
void removeChild(int column, int row);
void removeChild(int row);
+ void removeAllChilds();
virtual quint64 id() const;
AbstractTreeItem *child(int column, int row) const;
AbstractTreeItem *child(int row) const;
- AbstractTreeItem *childById(int column, const uint &id) const;
- AbstractTreeItem *childById(const uint &id) const;
+ AbstractTreeItem *childById(int column, const quint64 &id) const;
+ AbstractTreeItem *childById(const quint64 &id) const;
int childCount(int column) const;
int childCount() const;
signals:
void dataChanged(int column = -1);
void newChild(AbstractTreeItem *);
- void childDestroyed(int row);
+ void childRemoved(int row);
+ void childsRemoved(int firstRow, int lastRow);
+
+ void beginRemoveChilds(int firstRow, int lastRow);
+ void endRemoveChilds();
private slots:
void childDestroyed();
private:
QHash<int, QList<AbstractTreeItem *> > _childItems;
- QHash<int, QHash<quint64, AbstractTreeItem *> > _childHash; // uint to be compatible to qHash functions
- AbstractTreeItem *_parentItem;
+ QHash<int, QHash<quint64, AbstractTreeItem *> > _childHash; // uint to be compatible to qHash functions FIXME test this
Qt::ItemFlags _flags;
int defaultColumn() const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
- QModelIndex indexById(uint id, const QModelIndex &parent = QModelIndex()) const;
+ QModelIndex indexById(quint64 id, const QModelIndex &parent = QModelIndex()) const;
QModelIndex indexByItem(AbstractTreeItem *item) const;
QModelIndex parent(const QModelIndex &index) const;
private slots:
void itemDataChanged(int column = -1);
void newChild(AbstractTreeItem *child);
- void childDestroyed(int row);
+
+ void beginRemoveChilds(int firstRow, int lastRow);
+ void endRemoveChilds();
+
+ void childRemoved(int row);
+ void childsRemoved(int firstRow, int lastRow);
protected:
void appendChild(AbstractTreeItem *parent, AbstractTreeItem *child);