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. [SOLVED] Run Function on Dialog Close
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Run Function on Dialog Close

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.4k Views 1 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.
  • A Offline
    A Offline
    andrewhopps
    wrote on 6 May 2014, 22:30 last edited by
    #1

    The dialog window provides access to database, so when I close the dialog, I want my combobox to be updated with the updated information. I have been looking for way too long and have found answers that strayed from what I either understood or what my goal was, and the search function is terrible for trying to find specifics.

    How can I, in some way, have my combobox query the db when the dialog box is closed? (Only need to know how to get the close event to my main window, and then I can run my update function when the close event returns true)

    1 Reply Last reply
    0
    • M Offline
      M Offline
      MuldeR
      wrote on 7 May 2014, 00:55 last edited by
      #2

      How do you show the dialog?

      Normally you could do something like this:
      @MyDialog *myDialog = new MyDialog(this);
      myDialog->exec(); //blocks until dialog is done with!
      doSomethingAfterDialog();@

      Other than that, you can of course re-implement the closeEvent() of your dialog class and then do whatever is needed there. Lats but not least, you could connect to the dialog's accepted() or finished() signal.

      My OpenSource software at: http://muldersoft.com/

      Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

      Go visit the coop: http://youtu.be/Jay...

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andrewhopps
        wrote on 7 May 2014, 01:50 last edited by
        #3

        Thank you so much! I never even realized that anything below the execution was blocked, I was thinking far too into it and looked over the simple things :D

        1 Reply Last reply
        0

        1/3

        6 May 2014, 22:30

        • Login

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