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

Focus is not set to the right widget when docking/undocking

    XMLWordPrintable

Details

    Description

      This turns out to be quite sneaky when docking in tabbed mode, wher the widget getting the focus may very well not even be visible.

      This can be reproduced with the mainwindow demo by embedding lineEdits in the dockwidgets and using the following stylesheet:

      QLineEdit

      { background-color: yellow }

      QLineEdit:focus

      { background-color: blue ; color: white }

      1) Click in the red dock widget's entrybox on the upper right and type something. The background turns blue.
      2) Drag the red dock widget away from the main window to detach it. Note that it is still focused, provided the mouse is over the detached window. This may depend upon your window manager focus policy - I use focus-follows-mouse with compiz. Moving the mouse over the main window to focus it shows that, in my case, the line edit in the green dock window is focused in main window once the red dock has been detached.
      3) Go back to the now-detached red dock widget, click on the titlebar and drag it (noting that the line edit background is blue, as the dock widget has been focused) to the dock area on the far right, next to the white dock widget, such that it tabs with the white dock widget. Note that, although the dock widget being dragged was explicitly focused (by having the titlebar clicked and dragged), it loses focus as soon as it is 'dropped'. In my case, the focus is on the green dock widget.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            ntg Pierre Rossi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes