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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.12.0 RC, 5.12.0
    • 5.12.0 Beta 2
    • Widgets: Main Window
    • None
    • Windows 10-64 bit. Visual Studio 2017, 5.12.0 beta 2 from installer.
    • Windows
    • d9200fcac58a9347decd417c217c18b7e34471ec (qt/qtbase/5.12.0)

    Description

      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)

      Attachments

        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

        Activity

          People

            anrocha André De La Rocha (Inactive)
            jim.albamont James Albamont
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes