From 49ae2f0b83e00429d79e37a6b708f359ddc0c3c1 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Fri, 28 Oct 2011 21:31:31 +1000 Subject: [PATCH] Make Ctrl+Tab key combo cycle main tabs --- Graphs/gGraphView.cpp | 4 ++++ mainwindow.cpp | 10 ++++++++++ mainwindow.h | 2 ++ mainwindow.ui | 5 ++++- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Graphs/gGraphView.cpp b/Graphs/gGraphView.cpp index f4d1a385..cbcb291b 100644 --- a/Graphs/gGraphView.cpp +++ b/Graphs/gGraphView.cpp @@ -2286,6 +2286,10 @@ void gGraphView::wheelEvent(QWheelEvent * event) void gGraphView::keyPressEvent(QKeyEvent * event) { + if (event->key()==Qt::Key_Tab) { + event->ignore(); + return; + } gGraph *g; for (int i=0;igroup()==0) { diff --git a/mainwindow.cpp b/mainwindow.cpp index dc4cbed0..8d1162b7 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -529,3 +529,13 @@ void MainWindow::on_action_Link_Graph_Groups_toggled(bool arg1) PROFILE["LinkGroups"]=arg1; if (daily) daily->RedrawGraphs(); } + +void MainWindow::on_action_CycleTabs_triggered() +{ + int i; + qDebug() << "Switching Tabs"; + i=ui->tabWidget->currentIndex()+1; + if (i >= ui->tabWidget->count()) + i=0; + ui->tabWidget->setCurrentIndex(i); +} diff --git a/mainwindow.h b/mainwindow.h index 175d05ad..c7246936 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -102,6 +102,8 @@ private slots: void on_action_Link_Graph_Groups_toggled(bool arg1); + void on_action_CycleTabs_triggered(); + private: Ui::MainWindow *ui; Daily * daily; diff --git a/mainwindow.ui b/mainwindow.ui index 1089620d..6bb458dd 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -657,10 +657,13 @@ F4 - + - + + Ctrl+Tab +