title: How to ENABLE close button in Qt
body: <p>Why when I run code bellow, I don't have close button, like on this screenshot?</p>
  
  <p><img src="https://i.stack.imgur.com/HGChQ.jpg" alt=""> </p>
  
  <p>There is also no close button with other flags, like <code>Qt::WindowMinimizeButtonHint</code> or <code>Qt::WindowMinMaxButtonsHint</code> and other.</p>
  
  <pre><code>#include &lt;QApplication&gt;
  
  int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
  
      QWidget wgt;
      wgt.setWindowFlags(Qt::Window | Qt::WindowMaximizeButtonHint);
      wgt.show();
      return a.exec();
  }
  </code></pre>
  
  <p>Close button is available with  <code>wgt.setWindowFlag(Qt::Window)</code>. Even without <code>wgt.setWindowFlag()</code> is still available. But as soon as I add second flag like <code>Qt::WindowMaximizeButtonHint</code> or any other, with button, that must become unavailable, close button become unclickable too.</p>