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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.8.x
    • 4.6.3, 4.7.1
    • Widgets: Itemviews
    • None
    • Windows 7
    • 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

          For Gerrit Dashboard: QTBUG-15834
          # Subject Branch Project Status CR V

          Activity

            People

              dedietri Gabriel de Dietrich (drgvond)
              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