diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2008-02-14 23:18:10 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2008-02-14 23:18:10 (GMT) |
commit | df3169273a3333efe8ecb45da51e4c53b5d27fe9 (patch) | |
tree | 7972ad42f50bf836d9a8e71ebc7f1f70b8250ee7 /Source/QtDialog/QCMakeCacheView.cxx | |
parent | 1c0595c73fe1fa88b67691794eef8ee10edfc257 (diff) | |
download | CMake-df3169273a3333efe8ecb45da51e4c53b5d27fe9.zip CMake-df3169273a3333efe8ecb45da51e4c53b5d27fe9.tar.gz CMake-df3169273a3333efe8ecb45da51e4c53b5d27fe9.tar.bz2 |
ENH: Add shortcut to start search/filter.
A bit of cleanup.
Disable tab navigation in cache variable list.
Enable home/end keys.
BUG: Ensure currently edited values are saved before doing configure.
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); } |