diff options
Diffstat (limited to 'doc/src/snippets/widgets-tutorial/childwidget/main.cpp')
-rw-r--r-- | doc/src/snippets/widgets-tutorial/childwidget/main.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/src/snippets/widgets-tutorial/childwidget/main.cpp b/doc/src/snippets/widgets-tutorial/childwidget/main.cpp new file mode 100644 index 0000000..8a97810 --- /dev/null +++ b/doc/src/snippets/widgets-tutorial/childwidget/main.cpp @@ -0,0 +1,17 @@ +#include <QtGui> + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + QWidget *window = new QWidget(); + window->resize(320, 240); + window->setWindowTitle(tr("Child widget")); + window->show(); + +//! [create, position and show] + QPushButton *button = new QPushButton(tr("Press me"), window); + button->move(100, 100); + button->show(); +//! [create, position and show] + return app.exec(); +} |