title: How can I disable Alt + F4 window closing using Qt?
body: <p>I've disabled X button in Qt from my dialog using this line:</p>
  
  <pre class="lang-c prettyprint-override"><code>myDialog-&gt;setWindowFlags(Qt::Dialog | Qt::Desktop)
  </code></pre>
  
  <p>but I couldn't detect <kbd>Alt</kbd> + <kbd>F4</kbd> using this code:
  </p>
  
  <pre><code>void myClass::keyPressEvent(QKeyEvent *e)
  {
      if ((e-&gt;key()==Qt::Key_F4) &amp;&amp; (e-&gt;modifiers()==Qt::AltModifier))
          doSomething();
  }
  </code></pre>
  
  <p>what should I do to detect <kbd>Alt</kbd>+<kbd>F4</kbd> or disable it in Qt?</p>