QDialog
をオーバーライドせずにサブクラス化するクラスexec()
、accept()
またはその内部でクラスreject()
を呼び出す別のクラスがあります。Dialog
mousePaintEvent
void Canvas::mousePressEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton){
if (dialog->isVisible()){
dialog->setModal(true);
dialog->move(QWidget::mapToGlobal(event->pos()));
//I connect the dialog's accepted signal to the CallingClass's slot, that uses the information taken from the dialog
connect(dialog, &Dialog::accepted, this, &CallingClass::slot);
dialog->exec();
}
}
if (dialog->isVisible()){
if (dialog->rect().contains(event->pos())){
dialog->reject();
}
}
}
チェックのためにDialogの存在を使用しようとしましたが、delete
実際には機能しませんでした(dialog.reject()の後に入れました)最後のifですが、.reject()の後は何も機能しないと思い始めました。どうすればいいですか?