Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-20529

When a button's menu is shown a second time in a QGraphicsScene then it can end up being cut off

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 4.7.3, 4.8.5
    • Widgets: GraphicsView
    • None

      When a button's menu is shown a second time in a QGraphicsScene then it can end up being cut off if it is placed to the right/bottom of the QGraphicsScene. The first time it is shown correctly, but the subseqent times it is not.

      With the attached patch to the boxes demo, double click on the "dialog" on the graphicsscene to flip it round and then move it to the bottom right. By clicking on the bottom button it will show a menu, the first time it pops up it is fine, the second it is shifted to the right.

      The reason this occurs is because in qmenu.cpp, when it is checking where the menu should be it decides the second time that it does not need to be adjusted for the desktop because once the menu is embedded in the QGraphicsScene it sets the attribute - DontShowOnScreen. This causes it not to be adjusted the second time around and therefore it is not placed correctly.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Unassigned Unassigned
            andysh Andy Shaw
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes