#ifndef MAINWINDOW_H
#define MAINWINDOW_H #include <QMainWindow>
#include <QRadioButton>
#include <QButtonGroup> class MainWindow : public QMainWindow
{
Q_OBJECT public:
MainWindow(QWidget *parent = );
~MainWindow(); QRadioButton* radio0[];
QRadioButton* radio1[]; QButtonGroup* group[];
}; #endif // MAINWINDOW_H
#include "mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
this->resize(,);
this->centralWidget(); QString str0[] = {"笔记本","电话","打印机"};
QString str1[] = {"萝卜","白菜","青椒"}; group[] = new QButtonGroup(this);
group[] = new QButtonGroup(this); int xpos = , ypos = ;
for(int i=;i<;i++)
{
radio0[i] = new QRadioButton(str0[i],this);
group[]->addButton(radio0[i]);
radio0[i]->setGeometry(xpos,ypos,,); radio1[i] = new QRadioButton(str1[i],this);
group[]->addButton(radio1[i]);
radio1[i]->setGeometry(xpos+,ypos,,); ypos += ;
}
} MainWindow::~MainWindow()
{ }
#include "mainwindow.h"
#include <QApplication> int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show(); return a.exec();
}

最新文章

  1. Linux运维工程师入门须掌握的10个技术点
  2. 20145218 《Java程序设计》第四周学习总结
  3. YAR 并行RPC框架研究
  4. NOSQL Mongo入门学习笔记 - MongoDB的安装(一)
  5. bzoj 3158 千钧一发(最小割)
  6. Cocos2d-x 学习(1)—— 通过Cocos Studio创建第一个Demo
  7. 黑马程序猿——java基金会--jdk、变量
  8. C语言库函数大全及应用实例十一
  9. (中等) CF 585B Phillip and Trains,BFS。
  10. scanf函数之扫描集
  11. C++11 标准新特性: 右值引用与转移语义
  12. nodejs之socket.io模块——实现了websocket协议
  13. Dynamics CRM2013 任务列表添加自定义按钮
  14. Mybatis 源码学习系列
  15. Web应用程序架构的比较
  16. vue中用ajax上传文件
  17. Custom partition assignment and migration kafka集群扩充迁移指定partition
  18. 利用Python制作简单的小程序:IP查看器
  19. ROS Qt Creator Plug-in wiki
  20. Windows 安装 docker 以及1709的简单使用

热门文章

  1. iOS的REST服务-备
  2. mongodb 排序 Unable to determine the serialization information for the expression 异常
  3. oracle中的日期加减法
  4. Android自定义控件 开源组件SlidingMenu的项目集成
  5. 学渣上手 LaTeX 完成毕业论文
  6. TRAFFIC LIGHTS POJ 1158
  7. combobox的不常用的方法和将txt文本内容加到textbox中显示
  8. Delphi对ini文件的操作
  9. DateTime用法二
  10. Windows 已在 DImageProcess.exe 中触发一个断点。