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. QMenu behaviour with QMainWindow/QGLWidget
Forum Updated to NodeBB v4.3 + New Features

QMenu behaviour with QMainWindow/QGLWidget

Scheduled Pinned Locked Moved General and Desktop
9 Posts 2 Posters 2.2k 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.
  • G Offline
    G Offline
    gsxruk
    wrote on last edited by
    #1

    Hi,

    I am working on an app and observed an odd behaviour with the menu. I wasn't sure if I'd done something to cause it so I reduced it to a simple form. My test case simply creates a QMainWindow, adds a QMenu named "File" with a single item to the menubar and sets the central widget to an empty QGLWidget.

    In this case the following occurs:

    1. "File" is pressed and the menu opens, as expected.
    2. "File" is pressed again and the menu closes, as expected.
    3. "File" is pressed again and nothing happens, not as expected.
    4. "File" is pressed again and the menu opens.

    This behaviour repeats where only every other press opens the menu. However, the following does appear to work as expected:

    1. "File" is pressed and the menu opens, as expected.
    2. The empty central widget is pressed and the menu closes, as expected.
    3. "File" is pressed again and the menu opens, as expected. Etc.

    If the central widget is swapped for a different widget (I tried a QPushButton), the menu works as I would expect, with each press opening and closing the menu in turn.

    Could someone please advise if there is there something extra I need to do when using a QGLWidget? Or is this not the expected behaviour?

    Thanks.

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

      Hi and welcome to devnet,

      Indeed, this is not the expected behavior. What OS/Qt combination are you running ?

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

        Thanks.

        I'm using Qt Creator 3.0.1 (Qt 5.2.1) with Linux Mint 16 x64.

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

          Can you test if you have the same behavior with the latest 5.3 ?

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

            I could only find 5.3.0 Alpha. Was that the one to test?

            I downloaded and built that. The result was the same as 5.2.1.

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

              Yes that's the one (there might also be the beta not far away)

              Anyway, you should check the "bug report system":http://bugreports.qt-project.org to see if it's something known. If not you should consider opening a new bug report providing a minimal compilable example that shows the behavior.

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

                OK, I'll do that. Thanks for your help.

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

                  You're welcome !

                  If you open a bug report, please post a link here so other forum users may find it more easily if they encounter the same problem as you

                  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
                  • G Offline
                    G Offline
                    gsxruk
                    wrote on last edited by
                    #9

                    I opened a new bug report "QTBUG-37720.":https://bugreports.qt-project.org/browse/QTBUG-37720

                    Thanks.

                    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