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

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

    XMLWordPrintable

Details

    • Windows
    • cf9c94e85 (dev)

    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

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes