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

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

XMLWordPrintable

    • Windows
    • cf9c94e85 (dev), ce0349b41 (6.9)

      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

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes