16,212
社区成员
发帖
与我相关
我的任务
分享
Dialog::Dialog(QWidget *parent) :
QDialog(parent)
{
b=new QPushButton("OK",this);
b->setGeometry(10,10,33,23);
b->setDefault(true);
connect(b,SIGNAL(clicked()),this,SLOT(accept()));
//单击b按钮时对话框码为1,并隐藏对话框
c=new QPushButton("Cancel",this);
c->setGeometry(10,50,33,23);
connect(c,SIGNAL(clicked()),this,SLOT(reject()));
//单击C按钮时对话框返回码为0并隐藏对话框
}