mikro
29th November 2006, 22:42
hi,
i'd like to have shortcuts to change between the tabs of a tabwidget. after some searching through the fine manual and some posts i came up with:
page1 = new QAction(this);
page1->setShortcut(QKeySequence(tr("Ctrl+F1")));
connect(page1, SIGNAL(triggered()), this, SLOT(openPage1()));
which i hope will call
void MainWindow::openPage1() {
tabWidget->setCurrentIndex(0);
}
(and obviously two other, similar actions and functions for the other two tabs.
nothing happens. i also tried to set the translation to Strg+F1 in linguist as i am using the app in german. Where am i going wrong?
i'd like to have shortcuts to change between the tabs of a tabwidget. after some searching through the fine manual and some posts i came up with:
page1 = new QAction(this);
page1->setShortcut(QKeySequence(tr("Ctrl+F1")));
connect(page1, SIGNAL(triggered()), this, SLOT(openPage1()));
which i hope will call
void MainWindow::openPage1() {
tabWidget->setCurrentIndex(0);
}
(and obviously two other, similar actions and functions for the other two tabs.
nothing happens. i also tried to set the translation to Strg+F1 in linguist as i am using the app in german. Where am i going wrong?