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

Switched off Qt::ItemIsDropEnabled turns off drop between items

XMLWordPrintable

      1. Create app with QListView on QMainWindow.
      2. Subclass QStringListModel and reload flags(index) method.
      3. In this method switch off as QStringListModel::flags(index) & ~Qt::ItemIsDropEnabled;
      4. Attach sublcassed model to QListView.
      5. Set QAbstractItemView::InternalMove for the view.

      As the result strings in list will be moved but won't be able to drop anywhere in this list. Disabled Qt::ItemIsDropEnabled flag must disable drop on to the items but it disables drop even between items.

      The entire model/view present implementation looks ugly, non-comfortable and unfinished. There is no normal and simple way to create list of strings with easy D&D reordering - but this is the most demanded usage of D&D for QStringListModel. And there many other issues making present model/view implementation almost useless.

        1. main.cpp
          0.8 kB
          Christian Ehrlicher
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            chehrlic Christian Ehrlicher
            gourmand64 Gourmet
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes