Results 1 to 2 of 2

Thread: Drag and drop from list/tree widget to graphics view

  1. #1
    Join Date
    Mar 2012
    Posts
    14
    Thanks
    1
    Platforms
    Windows

    Default Re: Drag and drop from list/tree widget to graphics view

    Hi all,

    I would like my program to be able to click on an item in a list/tree widget and then drag to graphics view and drop it in..

    How do i enable the list/tree widget to allow me to drag the item and drop it into graphics view?

    What are the functions i need to implement?

    Thanks!


    Added after 33 minutes:


    My graphics scene is now able to detect drag event from the tree widget item..

    but what should I do to let it know which tree widget item is being dragged in?
    Last edited by chaltier; 24th March 2012 at 13:23.

  2. #2
    Join Date
    Sep 2009
    Location
    Aachen, Germany
    Posts
    60
    Thanks
    2
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Drag and drop from list/tree widget to graphics view

    Hi,

    well, that depends. What do you want the Graphics Scene to show? The item text?
    Just reimplement http://doc.qt.io/qt-4.8/http://qt-project.org/doc/qt-4.8/qtreewidget.html#mimeData and transfer the data you need via the mimeData of the Drop

Similar Threads

  1. drag and drop of tree item
    By sajis997 in forum Qt Programming
    Replies: 0
    Last Post: 14th December 2011, 23:33
  2. Replies: 1
    Last Post: 6th April 2011, 08:24
  3. drag and drop in only one hierarchy of the tree widget
    By fulbay in forum Qt Programming
    Replies: 0
    Last Post: 17th December 2010, 16:57
  4. Drag and Drop for tree model
    By frank100 in forum Qt Programming
    Replies: 5
    Last Post: 8th December 2010, 20:21
  5. Replies: 1
    Last Post: 18th November 2008, 07:57

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.