Important: Please read the Qt Code of Conduct -

How to transpose from a QDialog to another QDialog

  • Like in two steps, I want to close the first QDialog by clicking on a button, and open another QDialog.

    As long as both QDialog's have the same parent, it is possible?

    1° QDialog: confirm
    2° QDialog: edit

    Parent of his QDialog's:

    void Header::editClicked() {
    	if (!confirm)
    		confirm = new UserConfirmation(this);
    	if (confirm->result() == 1) {
    		if (!edit) {
    			edit = new EditCredentials(this);

    First QDialog:

    void Confirm::on_pb_next_clicked() {
    	QString password = ui->le_password->text();
    	if (password == "123") {
    		// here is the condition where i want to transpose de QDialog

  • sample the return values from each modal dialog to determine the appropriate action for the parent to take.

  • Lifetime Qt Champion

    Just as a note.
    For any design featuring a go to next page concept, please be aware of this class
    Its made for a sequence of pages with build-in support for next / prev etc for the navigation.

Log in to reply