summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/QCMakeCacheView.cxx
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2008-02-14 23:18:10 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2008-02-14 23:18:10 (GMT)
commitdf3169273a3333efe8ecb45da51e4c53b5d27fe9 (patch)
tree7972ad42f50bf836d9a8e71ebc7f1f70b8250ee7 /Source/QtDialog/QCMakeCacheView.cxx
parent1c0595c73fe1fa88b67691794eef8ee10edfc257 (diff)
downloadCMake-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.cxx32
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);
}