title: Qt setGeometry: Unable to set geometry
body: <p>Why?</p>
  
  <pre><code>setGeometry: Unable to set geometry 22x22+320+145 on QWidgetWindow/'WidgetClassWindow'. Resulting geometry:  116x22+320+145 (frame: 8, 30, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 22x22, maximum size: 16777215x16777215).
  </code></pre>
  
  <p>The project is:</p>
  
  <p>project.pro</p>
  
  <pre><code>QT       += core gui
  
  greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
  
  TARGET = untitled5
  TEMPLATE = app
  
  
  SOURCES += main.cpp\
          widget.cpp
  
  HEADERS  += widget.h
  </code></pre>
  
  <p>widget.h</p>
  
  <pre><code>#ifndef WIDGET_H
  #define WIDGET_H
  
  #include &lt;QWidget&gt;
  
  class Widget : public QWidget
  {
      Q_OBJECT
  
  public:
      explicit Widget(QWidget *parent = 0);
      ~Widget();
  
  private:
  };
  
  #endif // WIDGET_H
  </code></pre>
  
  <p>widget.cpp</p>
  
  <pre><code>#include "widget.h"
  
  #include &lt;QVBoxLayout&gt;
  
  Widget::Widget(QWidget *parent) :
      QWidget(parent)
  {
  
      QVBoxLayout *vLayout = new QVBoxLayout(this);
  
  }
  
  Widget::~Widget()
  {
  }
  </code></pre>
  
  <p>main.cpp</p>
  
  <pre><code>#include "widget.h"
  #include &lt;QApplication&gt;
  
  int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
      Widget w;
      w.show();
  
      return a.exec();
  }
  </code></pre>
  
  <p>Adding setGeometry(0, 0, 400, 300); in Widget constructor removes the issue. But the window will not be positioned beautifully at the center of the screen.</p>