WModelIndex WStandardItemModel::index(int row, int column, const WModelIndex& parent) const { WStandardItem *parentItem = itemFromIndex(parent, false); if (parentItem && row >= 0 && column >= 0 && row < parentItem->rowCount() && column < parentItem->columnCount()) return createIndex(row, column, static_cast<void *>(parentItem)); return WModelIndex(); }
int WStandardItemModel::columnCount(const WModelIndex& parent) const { WStandardItem *parentItem = itemFromIndex(parent, false); return parentItem ? parentItem->columnCount() : 0; }