diff options
Diffstat (limited to 'Source/QtDialog/QCMakeCacheView.cxx')
-rw-r--r-- | Source/QtDialog/QCMakeCacheView.cxx | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index ba9ece3..776e10b 100644 --- a/Source/QtDialog/QCMakeCacheView.cxx +++ b/Source/QtDialog/QCMakeCacheView.cxx @@ -75,6 +75,9 @@ QCMakeCacheView::QCMakeCacheView(QWidget* p) QAbstractItemView::EditKeyPressed | QAbstractItemView::AnyKeyPressed); + // tab, backtab doesn't step through items + this->setTabKeyNavigation(false); + // set up headers and sizes int h = 0; QFontMetrics met(this->font()); @@ -105,33 +108,14 @@ QCMakeCacheModel* QCMakeCacheView::cacheModel() const QModelIndex QCMakeCacheView::moveCursor(CursorAction act, Qt::KeyboardModifiers mod) { - // tab through values only (not names) - QModelIndex current = this->currentIndex(); - if(act == MoveNext) + // want home/end to go to begin/end of rows, not columns + if(act == MoveHome) { - if(!current.isValid()) - { - return this->model()->index(0, 1); - } - else if(current.column() == 0) - { - return this->model()->index(current.row(), 1); - } - else - { - return this->model()->index(current.row()+1, 1); - } + return this->model()->index(0, 1); } - else if(act == MovePrevious) + else if(act == MoveEnd) { - if(!current.isValid()) - { - return this->model()->index(0, 1); - } - else - { - return this->model()->index(current.row()-1, 1); - } + return this->model()->index(this->model()->rowCount()-1, 1); } return QTableView::moveCursor(act, mod); } |