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

Non-modal popups shouldn't affect focus

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.7
    • Fix Version/s: 5.7.0 RC
    • Component/s: Quick: Controls 2
    • Labels:
      None
    • Commits:
      9a1c9459a61cdd3ddb1bd0608a2caa9bae632e58

      Description

      After opening the menu below, it's then possible to hover over the button and have a tooltip displayed. This tooltip takes focus because eb6e122c6 is missing a check for modality before setting focus on the contentItem.

      import QtQuick 2.7
      import QtQuick.Window 2.2
      import QtQuick.Controls 2.0
      
      ApplicationWindow {
          width: 600
          height: 300
          visible: true
      
          onActiveFocusItemChanged: print(activeFocusItem)
      
          Button {
              text: "Button"
              hoverEnabled: true
              onClicked: menu.open()
              focusPolicy: Qt.TabFocus
              onHoveredChanged: print("hovered", hovered)
      
              ToolTip.text: "ToolTip"
              ToolTip.visible: hovered
          }
      
          Menu {
              id: menu
              y: parent.height / 2
      
              MenuItem {
                  text: "Item 1"
              }
              MenuItem {
                  text: "Item 2"
              }
              MenuItem {
                  text: "Item 3"
              }
          }
      }
      
      

        Attachments

        For Gerrit Dashboard: QTBUG-53420
        # Subject Branch Project Status CR V

          Activity

            People

            • Assignee:
              mitch_curtis Mitch Curtis
              Reporter:
              mitch_curtis Mitch Curtis
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes