QT学习一 Hello World

QDialog 对话框

QLabel 标签

Code:

 1 #include "mainwindow.h"
 2 #include <QApplication>
 3 #include <QLabel>
 4 #include <QDialog>
 5 int main(int argc, char *argv[])
 6 {
 7     QApplication a(argc, argv);
 8     QDialog *s = new QDialog();
 9     QLabel  *e = new QLabel();
10     e->setParent(s);
11     e->setText("Hello World");
12     s->show();
13     return a.exec();
14 }

 

posted @ 2019-03-12 23:28  晓风微微  阅读(115)  评论(0编辑  收藏  举报