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. Undocked Toolbar breaks Qt::WindowStaysOnTopHint
Forum Updated to NodeBB v4.3 + New Features

Undocked Toolbar breaks Qt::WindowStaysOnTopHint

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 2.3k 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.
  • iDoMnCiI Offline
    iDoMnCiI Offline
    iDoMnCi
    wrote on last edited by
    #1

    Hi, this is my first in the Qt community.

    Recently I've started working on a program, and I was introduced to Qt because the lead developer started the program using Qt. I have to say at first I was like "What the heck is Qt and why are we using it." Although, as time has passed and I became more familiar with Qt I've begun to fall in love with it.

    Now that I got that part out of the way I am contacting you guys today regarding an issue I'm experiencing.

    When I undock the Toolbar from the MainWindow and place it at a random location on my screen (undocked) my MainWindow and Toolbar loses its Qt::WindowStaysOnTopHint functionality. How can I prevent this?

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

      Hi and welcome to devnet,

      Can you share your QMainWindow setup code ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      iDoMnCiI 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Can you share your QMainWindow setup code ?

        iDoMnCiI Offline
        iDoMnCiI Offline
        iDoMnCi
        wrote on last edited by
        #3

        @SGaist
        Let me know if you need more code. Thanks!

        Was getting blocked for spam when trying to post my code. I put it up on Pastebin. http://pastebin.com/ReER7cgU

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          One thing you can check: print the content of the flags once the QToolBar has been undocked for both your tool bar as well as your main window.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          iDoMnCiI 1 Reply Last reply
          0
          • SGaistS SGaist

            One thing you can check: print the content of the flags once the QToolBar has been undocked for both your tool bar as well as your main window.

            iDoMnCiI Offline
            iDoMnCiI Offline
            iDoMnCi
            wrote on last edited by
            #5

            @SGaist said:

            One thing you can check: print the content of the flags once the QToolBar has been undocked for both your tool bar as well as your main window.

            I apologize but how do I do that? I've never really used the toolBar until now and I haven't had luck finding it online.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Connect to the topLevelChanged signal and in the slot print the flags from the QToolBar.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • iDoMnCiI Offline
                iDoMnCiI Offline
                iDoMnCi
                wrote on last edited by
                #7

                @SGaist said:

                Connect to the topLevelChanged signal and in the slot print the flags from the QToolBar.

                I seem to be having difficulties. When I go to undock the toolbar the MainWindow and toolbar will just disappear from view. I have to go into the process manager to kill it.

                I've connected the topLevelChanged to a function that sets the window flags of the toolbar and MainWindow to Qt::WindowStaysOnTopHint.

                I must be making an amateur mistake somewhere here...?

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  My suggestion wasn't to modify the flags at that moment but just to print them so you can compare them before and after undocking.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  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