add a PushButton child widget
This commit is contained in:
parent
b068dfbb69
commit
a2ed52c47f
7
main.cc
7
main.cc
@ -1,14 +1,19 @@
|
|||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QWidget>
|
#include <QtWidgets>
|
||||||
|
|
||||||
int main(int argc, char * argv[])
|
int main(int argc, char * argv[])
|
||||||
{
|
{
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
QWidget window;
|
QWidget window;
|
||||||
window.resize(600, 600);
|
window.resize(600, 600);
|
||||||
window.show();
|
window.show();
|
||||||
window.setWindowTitle("My Qt Application!");
|
window.setWindowTitle("My Qt Application!");
|
||||||
|
|
||||||
|
QPushButton * button = new QPushButton("Press me", &window);
|
||||||
|
button->move(100, 100);
|
||||||
|
button->show();
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user