title: Adding a label to a widget
body: <p>I am trying to add a label to the main window using Qt. Here is a piece of the code:</p>
  
  <pre><code>int main(int argc, char *argv[]) {
      QApplication app(argc, argv);
      QWidget Main_Window;
      QPixmap Image;
  
      Image.load("1837.jpg");
  
      QLabel i_label;
      i_label.setPixmap(Image);
      i_label.show();
  
      QPushButton Bu_Quit("Quit", &amp;Main_Window);
  
      QObject::connect(&amp;Bu_Quit, SIGNAL(clicked()), qApp, SLOT(quit()));
  
      Main_Window.show();
      return app.exec();
  }
  </code></pre>
  
  <p>I've been having a very hard time figuring out how to properly add <code>QLabel</code>s to <code>QWidget</code>s, I tried to set the <code>Main_Window</code> as the main widget using this method: <code>app.setMainWidget(Main_Window)</code> and the label was still outside the window. So how do I put labels into widgets using Qt?</p>