How to set input focus to a shown dialog in Qt?
- by Jake Petroules
In a button click slot, I create and exec() a dialog with a NULL parent. Inside the dialog's constructor, I have:
this->activateWindow();
this->raise();
this->setFocus();
The dialog is application modal and has strong focus. However, it does NOT respond to keyboard events until I click on it. How do I make the dialog get focus without having to click it?