int GraphModel::rowCount(const QModelIndex &parent) const { if (parent.column() > 0) { return 0; } GraphItem *parentItem = ParentItem(parent); if(parentItem) { return parentItem->ChildrenCount(); } return 0; }
int GraphModel::rowCount(const QModelIndex &parent) const { GraphItem *parentItem; if (parent.column() > 0) { return 0; } if (!parent.isValid()) { parentItem = rootItem; } else { parentItem = static_cast<GraphItem*>(parent.internalPointer()); } return parentItem->ChildrenCount(); }