Results 1 to 2 of 2

Thread: prevent drop in QTreeWidget

  1. #1
    Join Date
    Mar 2010
    Posts
    107
    Thanks
    22
    Qt products
    Qt4
    Platforms
    Windows

    Default prevent drop in QTreeWidget

    Hi
    Can someone advise me how to prevent a drop being accepted in certain circumstances in a QTreeWidget?
    I have derived a class from QTreeWidget and have reimplemented the DropEvent method.
    How do I get the information that tells me where the item is being dropped so I can tell whether or not the drop should be allowed?

    Thanks

    Graham

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: prevent drop in QTreeWidget

    The tree gets a dragEnter and then (if accepted) a dragMove event. This is where you can decide if a drop would be accepted or not.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QTReeWidget Drag and Drop
    By sujan.dasmahapatra in forum Qt Programming
    Replies: 5
    Last Post: 2nd June 2013, 15:15
  2. QTreeWidget & drag&drop
    By pfid in forum Qt Programming
    Replies: 0
    Last Post: 9th November 2010, 10:26
  3. QTreeWidget Drag and drop
    By zell99 in forum Newbie
    Replies: 15
    Last Post: 7th August 2010, 13:28
  4. QtreeWidget drag and drop
    By addu in forum Qt Programming
    Replies: 4
    Last Post: 30th June 2009, 09:41
  5. QTreeWidget Drag and Drop
    By tommydent in forum Qt Programming
    Replies: 10
    Last Post: 25th August 2008, 15:25

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.