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

Application deactivates when hiding a widget owning a native window

XMLWordPrintable

    • d7d9a14de00f9391ab0be953357d24713f580675

      This issue was originally seen in the "camera" example application in QtMobility when showing the captured image. (internal: MOBILITY-2677)
      After thorough investigation it seems like it's caused by the fact that the widget to be hidden has a native window.
      Attached test application can be used to reproduce the issue.
      It was reproducible with the camera example both with QMainWindow and QWidget as application base.
      Before hiding the native child the application main window is the active window and one of it's children has focus.
      After hiding, both active window and focus widget are NULL.
      It may also be that the issue is specific to this certain kind of case, i.e. it may not occur in all cases if hiding a widget with native window.

      Workaround for the issue is to activate the main window after hiding the native child:

      qApp->setActiveWindow(this);
      

      Fix for this would be nice to have as the use case from cameras point-of-view is quite common (hiding a viewfinder - that has always a native window in QtMobility on Symbian), but since the workaround is very easy and seems to work I'm not seeing this as a show stopper.

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

            e0348803 Miikka Heikkinen
            tuviitan Tuomas Viitanen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes