我有一个从QDialog派生的对话框AlarmSetup,其按钮设置如下:
// button box
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel |ButtonBox::Help, Qt::Horizontal, this);
buttonBox->button(QDialogButtonBox::Ok)->setText("übernehmen");
buttonBox->button(QDialogButtonBox::Cancel)->setText("abbrechen");
buttonBox->button(QDialogButtonBox::Help)->setText("Hilfe");
connect(buttonBox, SIGNAL(accepted()), this, SLOT(slotOk()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(slotCancel()));
connect(buttonBox, SIGNAL(helpRequested()), this, SLOT(slotHelp()));
从第二个对话框AlarmWindow中,我有一个插槽AlarmWindow :: slotOpen(),在其中创建AlarmSetup的新实例并评估AlarmSetup :: exec()的返回代码:
void AlarmWindow::slotOpen() // we create a new instance of AlarmSetup
{
if ( DBG_ALARM ) qDebug() <&