Just for completeness, the rowCount() was still faulty. Here's the corrected version:
Qt Code:
  1. int EnumItemModel::rowCount(const QModelIndex &parent) const
  2. {
  3. if (parent.column() > 0)
  4. return 0;
  5. if (!parent.isValid()) // return total top level items
  6. return enumTypes.count();
  7. long parentRowPlusOne = (long)parent.internalPointer();
  8. if (!parentRowPlusOne) // type name, e.g. "Color"
  9. return enumTypes[parent.row()].second.count();
  10. // leaf item, e.g. "Red"
  11. return 0;
  12. }
To copy to clipboard, switch view to plain text mode