Chinaunix首页 | 论坛 | 博客
  • 博客访问: 277999
  • 博文数量: 54
  • 博客积分: 2756
  • 博客等级: 少校
  • 技术积分: 677
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-16 22:51
文章分类

全部博文(54)

文章存档

2011年(30)

2010年(22)

2009年(2)

我的朋友

分类: C/C++

2011-06-14 15:27:12

#include
#include
#include
#include
#include
#include

#include "hello.h"

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QTextCodec::setCodecForTr(QTextCodec::codecForLocale());
    QWidget* pWidget = new QWidget;
    QLabel label(pWidget);
    label.setText(QObject::tr("同一个世界,同一个梦想!"));
    QPushButton* btn = new QPushButton(QObject::tr("关闭"),pWidget);
    QVBoxLayout* layout = new QVBoxLayout;
    layout->addWidget(&label);
    layout->addWidget(btn);
    pWidget->setLayout(layout);

    QObject::connect(btn,SIGNAL(clicked()),pWidget,SLOT(close()));

    pWidget->show();
    return app.exec();
    //hello w;
    //w.show();
}
阅读(2894) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~