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. Making child windows/widgets appear when unminimizing a window.

Making child windows/widgets appear when unminimizing a window.

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 1.6k Views
  • 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.
  • C Offline
    C Offline
    cuddlykittens11
    wrote on last edited by
    #1

    I've got a program where a QMainWindow instance is well, the main window of the application. There are a few child windows (sublcasses of QWidget) that have the window flag Qt::Tool set to them, because of that those windows don't appear in the task bar, just the QMainWindow.

    This causes a problem though when I want to unminimize the QMainWindow, the child windows will not appear (i.e. they are stuck behind some other application's window. How can I fix this so that the child windows will show when I click the taskbar button for the QMainWindow?

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

      Hi,

      That's intriguing, you could try to call "raise":http://doc.qt.io/qt-5/qwidget.html#raise on them

      Hope it helps

      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
      • C Offline
        C Offline
        cuddlykittens11
        wrote on last edited by
        #3

        The problem mainly is regarding "catching," when the QMainWindow is unminimized.

        I tried overloading the "changeEvent()":http://doc.qt.io/qt-5/qwidget.html#changeEvent and discovered that a "QEvent::ActivationChange":http://doc.qt.io/qt-5/qevent.html#Type-enum is sent everytime when unminimizing. But it seems to be whenever I click on the QMainWindow an ActivationChange event will be sent.

        The other issue too is that solution will never allow for the QMainWindow to be on top or selected.

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

          What about the showEvent and checking the spontaneous flag ?

          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
          • C Offline
            C Offline
            cuddlykittens11
            wrote on last edited by
            #5

            QMainWindow::showEvent() isn't called when un-minizming from the taskbar.

            Is there some window flag I could supply to the Qt::Tool windows that makes sure the windows are always on top?

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

              That's strange, it should be.

              However, did you check the spontaneus flag in the changeEvent ?

              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
              • C Offline
                C Offline
                cuddlykittens11
                wrote on last edited by
                #7

                Yes.

                The spontanious flag wasn't set.

                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