Results 1 to 1 of 1

Thread: Implementing drag drop for multiple QGraphicsItem

  1. #1
    Join Date
    Jun 2013
    Posts
    31
    Thanks
    8
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Implementing drag drop for multiple QGraphicsItem

    I am trying to implement a drag and drop for QGraphicItem. I am using the following method.

    http://stackoverflow.com/questions/1...-qgraphicsview


    However I need two objects of the same QGraphicsItem in my scene. I add them in the constructor by keeping them static. I also check for validations in the mousemove of QGraphicsItem and start the drag.

    GraphicsItemClass::mouseMove(QGraphicsSceneMouseEv ent *event)
    {
    if() //this = 1 static object created in GraphicsScene class
    {

    //code for starting drag similar to one in the link

    }
    else //The other static object created in Graphics Scene Class
    {

    //Same code.

    }
    }
    I tried changing the name of the byteArray and Mime Data in both the cases but still the problem exists. When I drop the object in Scene if I drop one item the other item also moves its position relatively. Can some one give me a solution for this.

    Thank You.
    Last edited by SiddhantR; 26th February 2014 at 11:07.

Similar Threads

  1. Qgraphicsitem drag and drop
    By erfan in forum Qt Programming
    Replies: 2
    Last Post: 9th June 2012, 06:17
  2. Implementing drag and drop for existing widget
    By dhjdhj in forum Qt Programming
    Replies: 5
    Last Post: 27th July 2010, 07:04
  3. Handle Drag & Drop Events with QGraphicsItem [SOLVED]
    By guilugi in forum Qt Programming
    Replies: 2
    Last Post: 13th July 2010, 19:05
  4. Replies: 0
    Last Post: 2nd June 2010, 18:52
  5. Drag-Drop in QGraphicsItem
    By zgulser in forum Qt Programming
    Replies: 1
    Last Post: 10th September 2009, 21:27

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.