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

Remove drag disabled rows on moving drag enabled

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.7.1
    • Widgets: Itemviews
    • None
    • Windows 7 x64, Linux mint, clang, mingw64

    Description

      Hello, friends!
      My model has flags disabling drag for 1st level indexes and drag enable for their leaves.

      flags method
      Qt::ItemFlags TreeModel::flags(const QModelIndex &index) const
      {
          if (!index.isValid()){
              return {};
          }
      
          Qt::ItemFlags result = Qt::ItemIsEnabled |
                  Qt::ItemIsSelectable;
      
          if (!index.parent().isValid()){ // Group nodes can accept drop
              result |= Qt::ItemIsDropEnabled;
          }
          else{   //leaves can be draged
              result |= Qt::ItemIsDragEnabled;
          }
      
          return result;
      }
      

      Selection behaviour set to SelectRows
      When I select an item that was drag disabled and item that drag enabled together and then drag them and drop, TreeModel::removeRows calls with arguments to remove drag disabled item.

      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
            __heaven__ Dmitriy Babkov
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes