title: Drawing text to the screen using QT
body: <p>I have been working on learning how to draw text to the screen with <code>QT</code> and I just can't figure out why it isn't drawing the text. 
  This is the code that I use:</p>
  
  <pre><code>#include "dialog.h"
  
  int main(int argc, char ** argv)
  {
  
      QApplication a(argc, argv);
  
      Dialog w;
      w.show();
  
      QPainter painter(&amp;w);
      painter.drawText(100,100,"hello");
  
  
      return a.exec();
  }
  </code></pre>
  
  <p>It does work when I have it in the dialog class, when I override the <code>paintEvent</code> function, but should it not work if it is in the main function as well?</p>