Hello, I have been experimenting some troubles with the D&D of a QTreeView widged.


1. When you drag an item to a dropable index it is drawn inside a black rectangle, is there any way to change this behavior so that the black box gets drawed in the whole row instead of a single item?
image.PNG


2. I was looking at the QTreeView drawRow implementation and get dissapointed about this:

Qt Code:
  1. if (headerSection == 0) { // headerSection means the column
  2. ...
  3. drawBranches(painter, branches, index);
  4. ...
  5. } else {
  6. ...
  7. }
To copy to clipboard, switch view to plain text mode 

I use model indexes based on QSqlRecords, so the column 0 == table id, so I set setColumnHidden(0,true) to hide the record ID field from the user and voila, branches dissapear. The obvious solution is to subclass, I need only change columnheader == Other_Columns and everything should be perfect. The problem arises when trying to create the subclass, I don't understand how to replace statements using the d-pointer like this:
Qt Code:
  1. const QPoint offset = d-> context scrollDelayOffset in the subclass
To copy to clipboard, switch view to plain text mode 
in the subclass context.


3. Is there a way to "move" nodes to another nodes on D&D operation instead of remove-add new rows? I mean, when you successful terminates a ActionMove drop operation, first the draged row is remove, then a new row is created and populated with the deleted row data. I just want to move.

Thanks in advance.