For some reasons, QPushButton shows up differently even though the code is mostly the same. Has anyone experienced the same issue and possibly have fixed it??

Here are the details:
Qt Code:
  1. QApplication app(argc, argv);
  2.  
  3. QPushButton btnQuit("Exit");
  4. btnQuit.resize(75, 30);
  5. btnQuit.setFont(QFont("Times", 18, QFont::Bold));
  6.  
  7. QObject::connect(&btnQuit, SIGNAL(clicked()), &app, SLOT(quit()));
  8.  
  9. btnQuit.show();
  10.  
  11. return app.exec();
To copy to clipboard, switch view to plain text mode 
results in:




Qt Code:
  1. QApplication appl(argc, argv);
  2.  
  3. QWidget wnd;
  4. wnd.resize(200, 120);
  5.  
  6. QPushButton btnQuit("Exit", &wnd);
  7. btnQuit.resize(75, 30);
  8. btnQuit.setFont(QFont("Times", 18, QFont::Bold));
  9. btnQuit.setGeometry(10, 40, 180, 40);
  10. QObject::connect(&btnQuit, SIGNAL(clicked()), &appl, SLOT(quit()));
  11.  
  12. wnd.show();
  13. return appl.exec();
To copy to clipboard, switch view to plain text mode 
results in: