Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to keep a dialog window in front of others windows.
Qt 6.12 LTS is out! See what's new in the release blog

How to keep a dialog window in front of others windows.

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 6.8k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello, :)

    I would like to ask how to keep a dialog window in front of the main window when I click over it.

    Thank you

    All the best

    Ricardo Sousa

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hello
      Do you try the method setModal(true) ?
      Fred

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Hello ,

        Thank you for answering!:)

        Yes I did this...

        MGVD->setModal(true);
        MGVD->show();

        But it didn´t work...

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          Is the "QDialog::exec":http://qt-project.org/doc/qt-4.8/qdialog.html#exec function you are looking for ?

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            like this...?

            MGVD->exec();

            no it didn´t work...

            I read about it and its seems to be it...

            Thank you cincirin :)

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              Re
              I have this kind of problem but only on Windows not in Linux, but I don't found the solution.
              Fred

              1 Reply Last reply
              0
              • D Offline
                D Offline
                DerManu
                wrote on last edited by
                #7

                Hi,
                try
                @QDialog *yourDialog = new ...
                yourDialog->setWindowFlags(yourDialog->windowFlags() | Qt::WindowStaysOnTopHint);
                yourDialog->show();@

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #8

                  That´s it!
                  Thank you DerManu!:)

                  Ricardo Sousa

                  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
                  • Unsolved