[SOLVED] How to close a dialog window (it's a little too modal)
Hi.
I'm using the Qt designer to create a dialog. I've added two buttons by hand, one Ok and one Cancel button.
with the signal slot editor I've connected the cancel buttons clicked() signal to the reject() slot of the dialog.
Clicking on the button when running the dialog has no effect. Not even clicking the windows "x" button in the window bar will close the window.
I show the dialog with a call
myDialog* dialog = new myDialog();
dialog->exec();
so what have I've done wrong?
The dialog is set to ApplicationModal.
(In the designer there is another modal button that can be checked in the propertyeditor for the QDialog)
Btw. what has happend to the qt-interest mailinglist?
Re: How to close a dialog window (it's a little too modal)
That's really odd behaviour. My first guess was that something went wrong when connecting the "clicked()" signal, but it's strange that even the window's close button shows no effect. Are you tampering with window flags in your dialog? Maybe you could post the code in question, it will probably help to find the source of the problem.
[SOLVED] Re: How to close a dialog window (it's a little too modal)
Well... I'll be damned...
It seems that I implemented a function called done(int) and that was not very clever...
Now it works. I don't know exactly why, but I'll never write a done(int) function again.
Re: [SOLVED] Re: How to close a dialog window (it's a little too modal)
Quote:
Originally Posted by
Morea
I don't know exactly why, but I'll never write a done(int) function again.
QDialog::done(int) happens to be virtual... :)