title: Qt QWidget::setGeomerty
body: <p>i'm stuck with a simple Function of Qt that does not work for me.i made a class that inherits 
  from QMainWindow and another class that inherits from QWidget.then i made from the second a member object(a pointer to) inside the first and assigned it as its centralWidget during the construction of my window.</p>
  
  <p>when it comes to adjust my centraWidget inside the window with the function QWidget::setGeomerty() it simply don't work.here's my code:</p>
  
  <pre><code>void MainWindow::show() 
  {
  
     //some code that centers my window on the screen
  
     int margin=this-&gt;width()/7;
  
     centralWidget()-&gt;setGeometry(margin,centralWidget()-&gt;geometry().top(),this-&gt;width()-margin,centralWidget()-&gt;geometry().bottom());
  
     QMainWindow::show();
  
  }
  </code></pre>
  
  <p>i know it might be stupid but i just can't figure it out.help me.</p>