Hello,
I am practicing the Qt tutorial here
http://doc.qt.nokia.com/4.3/tutorial-t4.html
Note that the QPushButton quit in constructor of MyWidget is a pointer. The example code works fine. But the button doesn't show up in the window after I changed the pointer to a stack variable, like
quit.setGeometry(62, 40, 75, 30);
connect(&quit, SIGNAL(clicked()), qApp, SLOT(quit()));
QPushButton quit(tr("Quit"), this);
quit.setGeometry(62, 40, 75, 30);
quit.setFont(QFont("Times", 18, QFont::Bold));
connect(&quit, SIGNAL(clicked()), qApp, SLOT(quit()));
To copy to clipboard, switch view to plain text mode
Can any expert point out why the button is not displayed after the change? Why is pointer important here? Thank you.
Bookmarks