gianhut
28th December 2008, 22:18
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:
QApplication app(argc, argv);
QPushButton btnQuit("Exit");
btnQuit.resize(75, 30);
btnQuit.setFont(QFont("Times", 18, QFont::Bold));
QObject::connect(&btnQuit, SIGNAL(clicked()), &app, SLOT(quit()));
btnQuit.show();
return app.exec();
results in:
http://img114.imageshack.us/img114/213/picture2rb0.png
QApplication appl(argc, argv);
QWidget wnd;
wnd.resize(200, 120);
QPushButton btnQuit("Exit", &wnd);
btnQuit.resize(75, 30);
btnQuit.setFont(QFont("Times", 18, QFont::Bold));
btnQuit.setGeometry(10, 40, 180, 40);
QObject::connect(&btnQuit, SIGNAL(clicked()), &appl, SLOT(quit()));
wnd.show();
return appl.exec();
results in:
http://img209.imageshack.us/img209/5108/picture3jh2.png
Here are the details:
QApplication app(argc, argv);
QPushButton btnQuit("Exit");
btnQuit.resize(75, 30);
btnQuit.setFont(QFont("Times", 18, QFont::Bold));
QObject::connect(&btnQuit, SIGNAL(clicked()), &app, SLOT(quit()));
btnQuit.show();
return app.exec();
results in:
http://img114.imageshack.us/img114/213/picture2rb0.png
QApplication appl(argc, argv);
QWidget wnd;
wnd.resize(200, 120);
QPushButton btnQuit("Exit", &wnd);
btnQuit.resize(75, 30);
btnQuit.setFont(QFont("Times", 18, QFont::Bold));
btnQuit.setGeometry(10, 40, 180, 40);
QObject::connect(&btnQuit, SIGNAL(clicked()), &appl, SLOT(quit()));
wnd.show();
return appl.exec();
results in:
http://img209.imageshack.us/img209/5108/picture3jh2.png