Fixes issue #3 \o/

A reminder for next time: enable various "Universal Access" options.
This commit is contained in:
John Maguire 2010-03-17 17:16:05 +00:00
parent 84bede61d3
commit fd2daf6fa2
1 changed files with 1 additions and 1 deletions

View File

@ -64,7 +64,7 @@ int SimpleTreeModel<T>::columnCount(const QModelIndex &) const {
template <typename T>
QModelIndex SimpleTreeModel<T>::index(int row, int, const QModelIndex& parent) const {
T* parent_item = IndexToItem(parent);
if (!parent_item || parent_item->children.count() <= row)
if (!parent_item || row < 0 || parent_item->children.count() <= row)
return QModelIndex();
return ItemToIndex(parent_item->children[row]);