How do I use the numbers as shortcuts? I can't seem to get them to work by themselves without adding a CTRL or ALT key before them.
For example, I have a QTabWidget with five pages and I setup five modes like this
modeBasicsAct
= new QAction(QIcon(":/images/mode_basics.png"), tr
("&Basics"),
this);
sm->registerAction(modeBasicsAct, "Modes", "1");
modeBasicsAct->setStatusTip(tr("Switch to Basics Mode"));
connect(modeBasicsAct, SIGNAL(triggered()), this, SLOT(switchMode(0)));
modeBasicsAct = new QAction(QIcon(":/images/mode_basics.png"), tr("&Basics"), this);
sm->registerAction(modeBasicsAct, "Modes", "1");
modeBasicsAct->setStatusTip(tr("Switch to Basics Mode"));
connect(modeBasicsAct, SIGNAL(triggered()), this, SLOT(switchMode(0)));
To copy to clipboard, switch view to plain text mode
and I have a slot function defined like this:
void MainWindow::switchMode(int pageId){
modesTabWidget->setCurrentIndex(pageId);
}
void MainWindow::switchMode(int pageId){
modesTabWidget->setCurrentIndex(pageId);
}
To copy to clipboard, switch view to plain text mode
The 1,2,3,4,5 shortcuts I set with registerAction do not switch the TabWidget's currentIndex to 0,1,2,3,or 4, like I write in the slot function.
Do you have any ideas as to why that won't work? I also noticed that it doesn't seem to work with any other shortcuts like CTRL+L. Maybe this has nothing to do with the numbers problem. anyways, sorry to bother you so much. I really appreciate your help. Your shortcut manager is phenomenal.
Bookmarks