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

QTreeView: Unable to move column focus with keyboard when selection behavior is set to QAbstractItemView::SelectRows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • Some future release
    • 4.7.0, 5.4.2
    • Widgets: Itemviews
    • None
    • Windows 7

    Description

      Steps to reproduce

      1. Create a standard QTreeView with the following properties:
        setSelectionBehavior(QAbstractItemView::SelectRows);
        setSelectionMode(QAbstractItemView::ExtendedSelection);
        setAllColumnsShowFocus(false);
      2. Add some columns and rows to the tree view
      3. Select a row with the mouse. Notice the focus rectangle around the column that was clicked with the mouse.
      4. Press left and right arrow keys on the keyboard. Notice that nothing happens to the focus rectangle.

      Drawbacks

      1. When the contents is bigger than the view and both scrollbars are active, the left and right arrow keys will scroll the view horizontally. However, since the focus remains on the same column, pressing the up and down arrow keys will force the view to scroll horizontally if the focused column was moved out of view.
      2. If you want different context menus for different columns, the keyboard cannot be used.

      Suggestions

      1. Move focus in response to the left and right arrow keys even if QAbstractItemView::SelectRows is the current selection behavior.

      Attachments

        1. main.cpp
          0.8 kB
        2. TreeSelection.pro
          0.1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            stian Stian Andre Olsen
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes