Chinaunix首页 | 论坛 | 博客
  • 博客访问: 856686
  • 博文数量: 1384
  • 博客积分: 27795
  • 博客等级: 上将
  • 技术积分: 16887
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-12 09:28
个人简介

只是心态,抓住机会。

文章分类

全部博文(1384)

文章存档

2014年(3)

2013年(403)

2012年(978)

分类: LINUX

2012-06-01 10:53:51

The final group box contains only push buttons and, like the second group box, it is checkable.

QGroupBox *Window::createPushButtonGroup() { *groupBox = new (tr("&Push Buttons")); groupBox->setCheckable(true); groupBox->setChecked(true);

We create a normal button, a toggle button, and a flat push button:

*pushButton = new (tr("&Normal Button")); *toggleButton = new (tr("&Toggle Button")); toggleButton->(true); toggleButton->(true); *flatButton = new (tr("&Flat Button")); flatButton->(true);

Push buttons can be used to display popup menus. We create one, and attach a simple menu to it:

*popupButton = new (tr("Pop&up Button")); *menu = new (this); menu->(tr("&First Item")); menu->(tr("&Second Item")); menu->(tr("&Third Item")); menu->(tr("F&ourth Item")); popupButton->(menu);

Finally, we lay out the widgets vertically, and return the group box that we created:

*vbox = new ; vbox->(pushButton); vbox->(toggleButton); vbox->(flatButton); vbox->(popupButton); vbox->(1); groupBox->setLayout(vbox); return groupBox; }
阅读(2253) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~