PDA

View Full Version : Itemview D&D mimeData



chocolate
16th March 2009, 17:30
I have and QTableView that I have set to allow drag and drops. I implemented these three methods in the model: mimeTypes, mimeData and dropMimeData. When I attempt to drag and item from my view and drop it in a different location within the same view, I can see that mimeTypes is called and dropMimeData is called, but I do not see when mimeData is called. Isn't the QTableView supposed to automatically call mimeData? I really do not want to subclass the QTableView if I don't have to.

wysota
16th March 2009, 17:49
mimeData is used for dragging, not dropping. It will be called earlier in the sequence.

chocolate
16th March 2009, 17:54
I put a print in my mimeData and the other methods and did not see it called. That is why I am confused about it. I knew it was used for dragging (exporting the data into the QMimeData).

wysota
16th March 2009, 18:48
Maybe the prototype of the method is incorrect? Double check the const keywords, etc.

chocolate
17th March 2009, 22:10
Thanks, I got that working. I fat-fingered something else, so that it wasn't called. :p

Has anyone seen any problems with a seg fault when dropping an item into the table view (not specifically on an item in the view)?

wysota
18th March 2009, 09:40
Even if I answer "yes" here, it won't help you much as the number of different thing causing a segmentation fault can be huge. It'd be better if you provided a backtrace from the debugger and/or contents of your dropMimeData method.

chocolate
19th March 2009, 16:44
Thanks anyway. I have to do the flags correctly and handle it when dropping onto the blank space in the view.