Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to transpose from a QDialog to another QDialog
Forum Updated to NodeBB v4.3 + New Features

How to transpose from a QDialog to another QDialog

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 211 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nicolas Fernando
    wrote on last edited by Nicolas Fernando
    #1

    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);
    		
    	confirm->show();
    	if (confirm->result() == 1) {
    		if (!edit) {
    			edit = new EditCredentials(this);
    		}
    		edit->show();
    	}
    }
    

    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
    		this->setResult(1);
    	}
    }
    
    1 Reply Last reply
    0
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote on last edited by
      #2

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

      I light my way forward with the fires of all the bridges I've burned behind me.

      1 Reply Last reply
      1
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        Just as a note.
        For any design featuring a go to next page concept, please be aware of this class
        https://doc.qt.io/qt-5/qwizard.html#details
        Its made for a sequence of pages with build-in support for next / prev etc for the navigation.

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved