Results 1 to 1 of 1

Thread: Drag & Drop when parent and childs accept drops?

  1. #1
    Join Date
    Jan 2007
    Location
    Augsburg, Germany
    Posts
    75
    Thanks
    4
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Drag & Drop when parent and childs accept drops?

    Hello,

    I've some questions about the drag & drop functionality of Qt. It does not work as I expected but I think thats because of my lack of understanding.

    In my program for example I have a QTabWidget which accepts drops. The tab widget contains some QTreeView's where each of them also accepts drops. When I'm dragging something over the QTreeView, the QTabWidget receives the dragEnterEvent() etc.. It does not accept the drag event so I thought the drag event will be redirected to the next child which accepts drops, but it does not!

    So how can I get my QTreeView's to receive their drop data?

    PS: Also my QTabWidget receives a dragEnter and dragLeave event for each of it's child widgets (QTabBar, the corner widgets), but the drag event does not contain any information about the window under the mouse ... so in my thought I should not receive these events? But that's maybe a 4.4.0 bug (can't update at the moment).

    EDIT: Seems like I've posted too fast ... QApplication walks up from the drag receiver to a parent which accepts drags - so it seems to be my fault.

    EDIT #2: Ok, all my fault, the model on the tree did not return Qt::ItemIsDropEnabled argh ...

    Thanks for your suggestions,
    Christoph
    Last edited by gri; 17th October 2008 at 11:57.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.