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] Showing a DialogBox instead of Exec.
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Showing a DialogBox instead of Exec.

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.1k 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.
  • V Offline
    V Offline
    vezprog
    wrote on last edited by
    #1

    Here is the issue, I am currently trying to show a Dialog box by creating an instance of the dialog box, then showing the box.

    i.e.

    @
    void mainWindow::dialogShow()
    {
    randomDialog dialog;
    dialog.show();
    }
    @

    randomDialog is a dialog box I designed in Qt Designer and all header files are linked in the beginning of the .cpp file (including the ui_randomDialog.h file).

    dialogShow() is connected to a button.

    So, this fails to show the dialog box, but using .exec() works perfectly. Yet, exec does not allow both boxes to run simultaneously, aka once the dialog box is open, the other form cannot execute any code.

    I was linked this http://developer.qt.nokia.com/doc/qt-4.7/qdialog.html#id-8f49114e-2fb8-4525-8a9d-af84f69df7e6 previously when I had this issue and used exec to get by. This time I would like to use modeless dialogs instead of modal. Any ideas on how to get the .show() to work?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vsorokin
      wrote on last edited by
      #2

      Try

      @void mainWindow::dialogShow()
      {
      randomDialog *dialog = new randomDialog(this);
      dialog->show();
      }@

      and not forget make "delete" for this object

      --
      Vasiliy

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vezprog
        wrote on last edited by
        #3

        Ha! That worked, thank you!

        1 Reply Last reply
        0

        • Login

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