只是心态,抓住机会。
全部博文(1384)
分类: 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; }