SetCentralWidget in mainWindow
I have a mainWindow, and I call a dialog. In this dialog, I have a PushButton, and when I click close a dialog ( close(); ). I close but don't close a mainWindow, close only the dialog. I need appear other dialog when i click in this button, it is possible??
sorry my bad english...
URGENT...
Re: SetCentralWidget in mainWindow
you can check the result code of exec() or done() and then show up the other dialog
Re: SetCentralWidget in mainWindow
I go to try to explain the problem better, what the following one is transferred and: I have 1 mainwindow, and 2 dialogs.
When beginning the program opens in mainwindow, where it has 1 button to go for the XDIALOG, in this XDIALOG opens inside of mainwindow (setCentralWitget).
I am in the XDIALOG, and clico in a button and want that it inside appears of same centralWitget the YDIALOG.
The problem is that I do not know as to inside make this exchange of DIALOGS of centralWitget of mainWindow.
Re: SetCentralWidget in mainWindow
I use this in mainWindow:
x = new XDialog;
this->setCentralWidget(x);
Re: SetCentralWidget in mainWindow
Just an idea, but I would have a QFrame object as the central widget. Then use that as the parent for your XDIALOG and YDIALOG widgets. You can then make the appropriate one visible in response to the buttons. Have you considered putting the dialogs onto a QTabWidget and let the user select what they want to do?
Re: SetCentralWidget in mainWindow
I take a screenshots...
1- start program:
http://img100.imageshack.us/img100/2...pturaecrao.png
2- click to dialog A, and this apear in centralWitget part of mainwindow
http://img227.imageshack.us/img227/5...pturaecra1.png
3- click to close a dialog A, but i need lauch a DIALOG B, in this same centralWitget, but only close a dialog and don't launch nothing
http://img153.imageshack.us/img153/6...pturaecra2.png
Re: SetCentralWidget in mainWindow
OK, I think I see what you want to do, but...
The QDialog is supposed to be a top level widget - ie it is managed by your window manager and should have the appropriate decorations, such as a title bar and close button.
I would suggest looking at the tutorials for wizzards.