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. Single Modeless Dialog

Single Modeless Dialog

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 838 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.
  • B Offline
    B Offline
    Burner147
    wrote on last edited by
    #1

    I know how to add a modal and modeless dialog to pop up. What I can't find is how do you have a modeless window pop open and not allow the user to continue to open new windows?

    .h
    private:
    MyDialog *mDialog;

    .cpp
    mDialog = new MyDialog(this);
    mDialog->show();

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

      hi and welcome
      with new windows, you mean another copy of Mydialog?
      you could test with
      if (mDialog!=NULL && mDialog->isVisible() ) return;

      set mDialog =NULL in constructor.

      B 1 Reply Last reply
      0
      • mrjjM mrjj

        hi and welcome
        with new windows, you mean another copy of Mydialog?
        you could test with
        if (mDialog!=NULL && mDialog->isVisible() ) return;

        set mDialog =NULL in constructor.

        B Offline
        B Offline
        Burner147
        wrote on last edited by
        #3

        @mrjj

        Thanks, but that causes the .exe to crash

        mrjjM 1 Reply Last reply
        0
        • B Burner147

          @mrjj

          Thanks, but that causes the .exe to crash

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          did you set mDialog=NULL; at constructor?
          else it just has random value and u will crash.

          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