Permalink
Browse files

Tweak creating index for symbols model.

  • Loading branch information...
1 parent 82185b4 commit 556707fa684741fbcd5624821c31fb2e17a6085d @gottcode committed Aug 3, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/symbols_model.cpp
View
@@ -268,7 +268,8 @@ QModelIndex SymbolsModel::index(quint32 unicode) const
QModelIndex SymbolsModel::index(int row, int column, const QModelIndex& parent) const
{
- return hasIndex(row, column, parent) ? createIndex(row, column, m_symbols.at((row * 16) + column)) : QModelIndex();
+ int pos = (row * 16) + column;
+ return (!parent.isValid() && (pos < m_symbols.count())) ? createIndex(row, column, m_symbols.at(pos)) : QModelIndex();
}
//-----------------------------------------------------------------------------

0 comments on commit 556707f

Please sign in to comment.