PDA

View Full Version : Question about window focus.



robgeek
9th February 2016, 14:23
Good day!

I have a QMainWindow with 3 buttons inside, lets call it window1. When i click on button1, for example, it opens a QDialog window. The problem is when i click any one of these buttons and this QDialog opens, i cannot access window1 again to open the others QDialog through those others buttons!

How can i change that?

Lesiok
9th February 2016, 14:30
How You open this QDialog ? You must do it with show not with exec.

anda_skoa
9th February 2016, 14:31
Sounds like you are opening the dialog as a "modal" dialog, meaning it prevents user interaction with its parent (Window modality) or any other window of the application (application modality).

Usually QDialog is non-modal, so you either set the modality or you are calling QDialog::exec().

Cheers,
_

robgeek
9th February 2016, 16:56
Yes, i was using exec(). I'll change to show().

Thanks!