我希望禁止主窗口的任何操作,包括关闭,同时保持子窗口打开。
我尝试:
// child window
Settings::Settings(QWidget *parent) :
QWidget(parent),
ui(new Ui::Settings)
{
ui->setupUi(this);
((QWidget*)parent)->setEnabled(false); // or parent->setEnabled(false);
...
在设置->显示();
时出现分段错误。
我尝试从设置构造函数/析构函数发送信号到MainClass
插槽。
void MainClass::Enable(bool enable)
{
qDebug() << "detect signal enable"; //
this->setEnable(enable);
}
但是信号没有被发送。
当然,我将
Settings
连接到MainClass
))。
在Settings
的任何其他函数中都可以发出信号。