- if(parent.isValid())
- return static_cast<AbstractTreeItem*>(parent.internalPointer())->columnCount();
- else
- return rootItem->columnCount();
+ Q_UNUSED(parent)
+ // since there the Qt Views don't draw more columns than the header has columns
+ // we can be lazy and simply return the count of header columns
+ // actually this gives us more freedom cause we don't have to ensure that a rows parent
+ // has equal or more columns than that row
+
+// if(parent.isValid()) {
+// AbstractTreeItem *child;
+// if(child = static_cast<AbstractTreeItem *>(parent.internalPointer())->child(parent.column(), parent.row()))
+// return child->columnCount();
+// else
+// return static_cast<AbstractTreeItem*>(parent.internalPointer())->columnCount();
+// } else {
+// return rootItem->columnCount();
+// }
+
+ return rootItem->columnCount();