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

Need a dragPixmap() virtual function in QAbstractItemView.

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P5: Not important
    • None
    • None
    • Widgets: Itemviews

    Description

      When I want to set my custom pixmap for dragging in a QAbstractItemView subclass, I have to override

        void QAbstractItemView::startDrag(Qt::DropActions supportedActions)
      

      because the default pixmap was created in the default implementation of this method, it cannot be altered in subclasses without overriding the method and executing a QDrag manually.

      What I suggest is to put the default pixmap into a virtual protected function like QPixmap dragPixmap(), which when overriden, we can use to return our custom pixmaps for dragging.

      Thanks for reading!

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            futurecode Yang Zhining
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes