Re: [PyQt] QTreeView DragDropMode (Code attached)

2012-04-26 Thread hosscomp
This is a zip file of the Exlipse project if anyone cares to take a look. At this point I am trying to figure out why the dragEnterEvent in compassTreeView.py doesn't cause a move action when source is self. http://python.6.n6.nabble.com/file/n4931964/CompassGui.zip CompassGui.zip -- View this m

Re: [PyQt] QTreeView DragDropMode (Copy vs. Move)

2012-04-24 Thread Bart Kroon
When time is short I would say, add a method to the source model that you can call from the target model that removes the received items. That would make it work at least. It might even be the best way to do such a thing, but I'm not sure. It seems you handle the dragged in mimedata as the obje

Re: [PyQt] QTreeView DragDropMode (Copy vs. Move)

2012-04-24 Thread hosscomp
No problem, Bart. Thanks for replying. I think I am on the right track (a right track) now. There seems to be many different ways to do what I am trying to accomplish, but I haven't gotten the hang of quickly figuring out the documentation and I am running out of time on this project. I think it w

Re: [PyQt] QTreeView DragDropMode (Copy vs. Move)

2012-04-21 Thread Bart Kroon
Sorry it took me so long, I was quite busy. My solution is used for moving items internally in one model. From your earlier mails I may have gotten the wrong idea. It seems you need to move the items from one model to another. Is this correct? Am I correct in assuming that your source model is

Re: [PyQt] QTreeView DragDropMode (Copy vs. Move)

2012-04-19 Thread hosscomp
More progress. I now have the two MineData types working so that a node dropped into the target tree is created with a different MIME_TYPE and in the dopMimeData method of the target model I have at the bottom: . . . if (mimedata.hasFormat('target_type')): self.removeRow(row,parentIndex) It d

Re: [PyQt] QTreeView DragDropMode (Copy vs. Move)

2012-04-17 Thread hosscomp
I may be talking to myself only, but I am getting closer. I subclassed two models with different MimeData subclasses of QMimeData giving them different MIME_TYPE strings. I created two instances of QTreeView, one with each of the models. One of the models (say model B) is set to accept both of the

Re: [PyQt] QTreeView DragDropMode (Copy vs. Move)

2012-04-12 Thread Bart Kroon
In my project I use a special mime type in DropMimeData() to recognise internal moves and handle them accordingly. I have set the view to handle drag and drop operations. You will need to subclass your model for this. ___ PyQt mailing listPyQt@river

Re: [PyQt] QTreeView DragDropMode (Copy vs. Move)

2012-04-10 Thread hosscomp
hosscomp wrote > > > hosscomp wrote >> >> I am looking at the documentation for QAbstractItemView Class. I have >> created a tree view and I would like it to accept drops from a different >> view, but also be able to move items within itself. None of the >> DragDropMode settings seem to allow

Re: [PyQt] QTreeView DragDropMode (Copy vs. Move)

2012-04-04 Thread hosscomp
hosscomp wrote > > I am looking at the documentation for QAbstractItemView Class. I have > created a tree view and I would like it to accept drops from a different > view, but also be able to move items within itself. None of the > DragDropMode settings seem to allow that. If I set it to Intern

[PyQt] QTreeView DragDropMode

2012-04-02 Thread Shoemaker, Ronnie A (N-UNITED SPACE ALLIANCE, LLC)
I am looking at the documentation for QAbstractItemView Class. I have created a tree view and I would like it to accept drops from a different view, but also be able to move items within itself. None of the DragDropMode settings seem to allow that. If I set it to InternalMove it acts the way I