Results 1 to 2 of 2

Thread: QTreeWidget - Drag and drop - highlight tree widget item with focus

  1. #1

    Question QTreeWidget - Drag and drop - highlight tree widget item with focus

    I have a QTreeWidget subclass with drop enabled. As I drag into the tree widget, I want the QTreeWidgetItem to highlight indicating the tree node where the drop will occur.

    I am receiving the events dragEnterEvent, dragMoveEvent, and dropEvent.

    How do I get the highlight behavior as the drag is occurring?

    Thank you in advance

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTreeWidget - Drag and drop - highlight tree widget item with focus

    May be u will need a delegate...
    if mouse is over a item, set some user defined role for this item.
    Then in the paint function of the delegate, use this role to paint the background

Similar Threads

  1. Drag and Drop item inside QTreeWidget
    By nina1983 in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2008, 11:43
  2. Drag from tree widget
    By EricF in forum Qt Programming
    Replies: 9
    Last Post: 17th December 2007, 23:09
  3. Drag an item from QTreeWidget and drop in TableView
    By steg90 in forum Qt Programming
    Replies: 8
    Last Post: 18th May 2007, 11:42

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.