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

Non-modal popups shouldn't affect focus

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.7.0 RC
    • 5.7
    • Quick: Controls 2
    • None
    • 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

            mitch_curtis Mitch Curtis
            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