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

QListView IconMode Drop Indicator (With Patch)

    XMLWordPrintable

Details

    Description

      When a QListView is in IconMode, the drop indicator is never painted, not even when its show property is true. This effects the drag and drop puzzle examples.

      #if QT_CONFIG(draganddrop)
      void QCommonListViewBase::paintDragDrop(QPainter *painter)
      {
          // FIXME: Until the we can provide a proper drop indicator
          // in IconMode, it makes no sense to show it
          dd->paintDropIndicator(painter);
      }
      #endif
      

      The cause is due to an else statement in the private implementation. If the else statement is commented out, the drop indicator is correctly painted.

      QAbstractItemView::DropIndicatorPosition QListViewPrivate::position(const QPoint &pos, const QRect &rect, const QModelIndex &idx) const
      {
         /*if (viewMode == QListView::ListMode && flow == QListView::LeftToRight)
      
          else
            return QAbstractItemViewPrivate::position(pos, rect, idx);
         *// << COMMENT THIS OUT to fix drop indicator
         return static_cast<QListModeViewBase *>(commonListView)->position(pos, rect, idx);
      }
      

      Please comment the else statement and allow the drop indicator to correctly be painted.

      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
            RobertBColton Robert B. Colton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes