⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 6_2.cpp

📁 一个qt设计的教程
💻 CPP
字号:
#include <qapplication.h>#include <qwidget.h>#include <qbuttongroup.h>#include <qradiobutton.h>class MyMainWindow:public QWidget{ public:    MyMainWindow(); private:    QButtonGroup *group;    QRadioButton *b1;    QRadioButton *b2;    QRadioButton *b3;};MyMainWindow::MyMainWindow(){ setGeometry(100,100,150,140); group = new QButtonGroup("Options",this); group->setGeometry(10,10,130,120); b1 = new QRadioButton("Choice 1",group); b1->move(20,20);  b2 = new QRadioButton("Choice 2",group); b2->move(20,50);  b3 = new QRadioButton("Choice 3",group); b3->move(20,80);   group->insert(b1); group->insert(b2); group->insert(b3);}main(int argc,char **argv){ QApplication a(argc,argv); MyMainWindow w; a.setMainWidget(&w); w.show(); a.exec();}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -