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

Windows/REG->5.12: Can no longer focus a QWidget created via createWindowContainer by mouse click



    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.12.0 Beta 2
    • Fix Version/s: 5.12.0 RC, 5.12.0
    • Component/s: Widgets: Main Window
    • Labels:
    • Environment:
      Windows 10-64 bit. Visual Studio 2017, 5.12.0 beta 2 from installer.
    • Platform/s:
    • Commits:
      d9200fcac58a9347decd417c217c18b7e34471ec (qt/qtbase/5.12.0)


      This breaks adding any OpenGL QWindow  to a QMainWindow in 5.12.  

      Creating a QWidget window container for an OpenGL window via createWindowContainer leads broken keyboard focus if it's added to a QMainWindow.  The container widget is never able to regain focus after after clicking on another widget.   This worked OK on 5.11.2

      Possibly related:  Focus handling is different in 5.12 even when not adding to QMainWindow. I need to set focus policy to StrongFocus otherwise it never gets focus.  On 5.11.2 focus just works.

      See attached example which contains both of the above cases.  It's the "openglwindow" example from the Qt examples with small modification with a key press handler to show which keys were pressed.  

       Steps to reproduce:

      • Click on combo
      • Click on openglwindow
      • Press key
        Expected: Key presses are received by the openglwindow
        Actual: Key presses stay in mainwindow (5.12)


        1. openglwindow_broken_focus.zip
          7 kB
        2. qtbug71352_log.txt
          10 kB
        3. qtbug71352.zip
          8 kB
        For Gerrit Dashboard: QTBUG-71352
        # Subject Branch Project Status CR V



            • Assignee:
              anrocha André De La Rocha
              jim.albamont James Albamont
            • Votes:
              2 Vote for this issue
              5 Start watching this issue


              • Created:

                Gerrit Reviews

                There are no open Gerrit changes