#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QLabel *label=new QLabel("您好");
label->show();
return a.exec();
}
#-------------------------------------------------
#
# Project created by QtCreator 2015-02-23T17:37:43
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = untitled6
TEMPLATE = app
SOURCES += main.cpp
运行效果如下:
原文地址:http://blog.csdn.net/myhaspl/article/details/43917953