首页| 论坛| 消息

回复: 在线坐等回答,急急急急急急急急
#6 回 5楼(wxj120bw) 的帖子 [111420211 08-12 16:53]
#include "main.h"
#include
#include
#include
#include
MyWidget::MyWidget(QWidget *parent):QWidget(parent)
{
setMinimumSize(200, 200);
QRadioButton *r1 = new QRadioButton("1",this);
QRadioButton *r2 = new QRadioButton("2",this);
QRadioButton *r3 = new QRadioButton("3",this);
QRadioButton *r4 = new QRadioButton("4",this);
QRadioButton *r5 = new QRadioButton("5",this);
QRadioButton *r6 = new QRadioButton("6",this);
QRadioButton *r7 = new QRadioButton("7",this);
QRadioButton *r8 = new QRadioButton("8",this);
QRadioButton *c1 = new QRadioButton("1",this);
QRadioButton *c2 = new QRadioButton("2",this);
QRadioButton *c3 = new QRadioButton("3",this);
QRadioButton *c4 = new QRadioButton("4",this);
QRadioButton *c5 = new QRadioButton("5",this);
QRadioButton *c6 = new QRadioButton("6",this);
QRadioButton *c7 = new QRadioButton("7",this);
QRadioButton *c8 = new QRadioButton("8",this);
QVBoxLayou ..
#7 回 6楼(111420211) 的帖子 [wxj120bw 08-12 20:34]
connect语句还提示段出错吗 mySlot函数为什么那样写?
#8 Re:回 5楼(wxj120bw) 的帖子 [tangxunmin 08-14 15:30]
引用第6楼111420211于2011-08-12 16:53发表的 回 5楼(wxj120bw) 的帖子 :
#include "main.h"
#include
#include
#include
#include
.......

信号跟槽连接要带参数的啊把参数带上试试
#9 [tangxunmin 08-14 15:32]
connect(c1, SIGNAL(clicked(bool)), this, SLOT(myslot(bool)));
void MyWidget::myslot(bool checked)
{
r1->setCheckable(true);
r1->setChecked(true);
r1->setAutoRepeat(true);
r1->setAutoExclusive(true);
}

<< 1 2 >> (2/2)

回复 发表
主题 版块