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

QTreeView drag pixmap rendering bug on Windows, due to missing style options

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 4.6.3, 4.7.1
    • Fix Version/s: 4.8.x
    • Component/s: Widgets: Itemviews
    • Labels:
      None
    • Environment:
      Windows 7
    • Commits:
      d63910575949106f84dacf04abaa14fc866aa66b

      Description

      When dragging a QTreeView row with multiple columns, the drag pixmap looks wrong on Windows (at least Windows 7) : each column gets a blue rounded-rect in the background, rather than seeing a single rounded-rect around the whole row (like we can see in the actual treeview).

      This is because QAbstractItemViewPrivate::renderToPixmap asks the delegate to draw the dragged indexes, but doesn't set option.viewItemPosition to Beginning/Middle/End.

      To see the bug for yourself, just edit examples/itemviews/dirview/main.cpp and add tree.setDragDropMode(QAbstractItemView::DragOnly),
      then drag a file on Windows, and look at the drag pixmap.

      I have a unittest and a patch, I'll make a merge request.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              dedietri Gabriel de Dietrich (drgvond)
              Reporter:
              dfaure David Faure (Private)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes