title: Qt change modality of a Dialog at run time without hide it for first time and than show
body: <p>I have a QMainWindow and from that I openend another dialog using dialog->show();
  Inside Dialog I have a button say "Button1" and "Button2".</p>
  
  <p>Here, When user press "Button1" than modality of Dialog should change to "Qt::ApplicationModal" and When user press "Button2" than modality of dialog should change to "Qt::NonModal".</p>
  
  <p>I can do this by using "setWindowModality(Qt::ApplicationModal);" inside "Button1" clicked followed by "hide(); and show();"  and "setWindowModality(Qt::NonModal);" inside "Button2" clicked followed by "hide(); and show();"</p>
  
  <p>But, if I use above method than QDialog gives a blink affect which is obvious as I am using "hide() and show()" function. This blink affect I do not want.</p>
  
  <p>So, kindly suggest:</p>
  
  <ol>
  <li>How to change modality of a QDialog opened by show() without using "hide()" and "show()" after changing modality?</li>
  <li>If there is no other way to change modality of a QDiloag at run time followed by "hide" and "show" than Is it possible to reduce the affect of QDialog disappears and then visible again.</li>
  </ol>
  
  <p>I do not want user to have a toggle effect on the QDialog, kindly suggest.</p>
  
  <p>Thanks,</p>