Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4242284
  • 博文数量: 1148
  • 博客积分: 25453
  • 博客等级: 上将
  • 技术积分: 11949
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-06 21:14
文章分类

全部博文(1148)

文章存档

2012年(15)

2011年(1078)

2010年(58)

分类: C/C++

2011-07-23 12:31:37

工程代码: 2_button_quit.rar  


  1. #include <QApplication>
  2. #include <QPushButton>
  3. #include <QFont>

  4. int main(int argc, char *argv[])
  5. {
  6.     QApplication app(argc, argv);
  7.     QPushButton *button = new QPushButton(QObject::tr("quit"));
  8.     button->resize(300,100);
  9.     button->setFont(QFont("Times",18,QFont::Bold));

  10.     QObject::connect(button,SIGNAL(clicked()),&app,SLOT(quit()));

  11.     button->show();

  12.     return app.exec();
  13. }










阅读(637) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~