July 6, 2011

Ketan Shah Ketan Shah
Lab Rat
59 posts

Main window focus problem

 

I am opening an another window from my main window..
What I want is, when the new window is opened, my main window should be disabled(deactivate).
and the main window should be enabled only if the new window is closed.
how can i do this..

Thanks in advance..

2 replies

July 6, 2011

HuXiKa HuXiKa
Lab Rat
79 posts

Make your window / dialog modal [doc.qt.nokia.com] .

 Signature 

If you can find faults of spelling in the text above, you can keep them.

July 6, 2011

Chuck Gao Chuck Gao
Lab Rat
329 posts

If your opened window is a QDialog based widget, you can make it by

  1. setModal(true)

For QWidget based widget, try
  1. setWindowModality ( Qt::WindowModality windowModality )

And these 2 are all using/in the event loop

 Signature 

Chuck

 
  ‹‹ Concept understanding on model view mechanism      Deep copy of a struct containing a QWidget* ››

You must log in to post a reply. Not a member yet? Register here!