主画面里面用了QDialogButtonBox,只设置了一个close按钮。下面的代码不能关闭窗口。
buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(close()));
同样改成
connect(buttonBox, SIGNAL(clicked()), this, SLOT(close()));
也不能关闭。
这是为什么呢?有明白人指点一下。