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

[Windows] Child window with Qt.WindowDoesNotAcceptFocus flag set still grabs focus

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7.3, 6.8.0
    • None
    • Windows

    Description

      A child window with the Qt.WindowDoesNotAcceptFocus flag set still steals focus from its parent window when it becomes visible.

      Code sample:

      import QtQuick
      
      Window {
          width: 640
          height: 480
          visible: true
          title: 'Main window'
      
          Window {
              id: childWindow
              width: 200
              height: 200
              title: 'Child window'
      
              //transientParent: null // it doesn't matter if it's set
              flags: Qt.WindowDoesNotAcceptFocus
          }
      
          TextInput {
              anchors.fill: parent
              onTextEdited: childWindow.visible = true
          }
      }
      

      Steps to reproduce:
      1. Click inside the main window to make TextInput active
      2. Press any key
      3. A child window will be shown

      Actual results: The text input loses focus
      Expected results: The text input doesn't lose the focus

      Attachments

        Issue Links

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

          Activity

            People

              vestbo Tor Arne Vestbø
              studiosus Vladimir Belyavsky
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change