Sergex
21st December 2011, 11:42
Hi,
I have an action with a keyboard shortcut in my main window that starts an operation called "process". But now I made a QDialog that pops up when a button is pressed, and in that dialog I set the value that the process operation in the main window needs. So for this I made the dialog modeless but while I'm on the dialog the keyboard shortcuts of the mainwindow don't work until I actually click on the mainwindow again. Since I vary the parameter in the QDialog I would like to not need to always click on the mainwindow after setting a value in the dialog to start a "process".
I tried doing:
//In main window
...
processAction = new QAction(this)
processAction->setShortcut(QKeySequence(Qt::Key_3));
...
myDialog = new QDialog(this)
myDialog->addAction(processAction);
But this didn't work.
Is there a way to do this??
Thanks.
I have an action with a keyboard shortcut in my main window that starts an operation called "process". But now I made a QDialog that pops up when a button is pressed, and in that dialog I set the value that the process operation in the main window needs. So for this I made the dialog modeless but while I'm on the dialog the keyboard shortcuts of the mainwindow don't work until I actually click on the mainwindow again. Since I vary the parameter in the QDialog I would like to not need to always click on the mainwindow after setting a value in the dialog to start a "process".
I tried doing:
//In main window
...
processAction = new QAction(this)
processAction->setShortcut(QKeySequence(Qt::Key_3));
...
myDialog = new QDialog(this)
myDialog->addAction(processAction);
But this didn't work.
Is there a way to do this??
Thanks.