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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 4.8.x
    • 4.6.3, 4.7.1
    • Widgets: Itemviews
    • None
    • Windows 7
    • d63910575949106f84dacf04abaa14fc866aa66b

      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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes