-void TreeModel::newChild(AbstractTreeItem *child) {
- appendChild(static_cast<AbstractTreeItem *>(sender()), child);
-}
-
-void TreeModel::beginRemoveChilds(int firstRow, int lastRow) {
- QModelIndex parent = indexByItem(static_cast<AbstractTreeItem *>(sender()));
- beginRemoveRows(parent, firstRow, lastRow);
-}
-
-void TreeModel::endRemoveChilds() {
- endRemoveRows();
-}
-
-void TreeModel::childRemoved(int row) {
- QModelIndex parent = indexByItem(static_cast<AbstractTreeItem *>(sender()));
- beginRemoveRows(parent, row, row);
- endRemoveRows();
-}
-
-void TreeModel::childsRemoved(int firstRow, int lastRow) {
- QModelIndex parent = indexByItem(static_cast<AbstractTreeItem *>(sender()));
- beginRemoveRows(parent, firstRow, lastRow);
- endRemoveRows();
+void TreeModel::beginAppendChilds(int column, int firstRow, int lastRow) {
+ AbstractTreeItem *parentItem = qobject_cast<AbstractTreeItem *>(sender());
+ if(!parentItem) {
+ qWarning() << "TreeModel::beginAppendChilds(): cannot append Childs to unknown parent";
+ return;
+ }
+ QModelIndex parent = indexByItem(parentItem, column);
+ Q_ASSERT(!_aboutToRemoveOrInsert);