Results 1 to 3 of 3

Thread: Interacting QGraphicsItems together

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Posts
    7
    Qt products
    Qt Jambi
    Platforms
    Windows

    Default Interacting QGraphicsItems together

    Hey Guys,

    I currently have a graphics scene with dynamic QGraphicsItems being added to the scene. I would like to snap these items together by dragging one item on top of another and releasing the mouse button.

    In the QGraphicsItem class i have the following function

    Qt Code:
    1. public void dragEnterEvent(QGraphicsSceneDragDropEvent event)
    2. {
    3. System.out.println("Dragged on the item");
    4. }
    To copy to clipboard, switch view to plain text mode 

    This code works fine when I drag some item from my desktop (say an Excel file), but it doesn't detect any item in my scene beign dragged on top of it.

    Any help would really be appreciated.

    Thanks
    Last edited by wysota; 16th April 2011 at 07:57.

Similar Threads

  1. Replies: 2
    Last Post: 8th December 2010, 10:51
  2. Replies: 5
    Last Post: 8th January 2010, 17:03
  3. Interacting with an API
    By srohit24 in forum Qt Programming
    Replies: 1
    Last Post: 5th April 2009, 14:17
  4. qt application interacting with GSMmodem in windows
    By jjbabu in forum Qt Programming
    Replies: 5
    Last Post: 15th October 2007, 11:22
  5. events interacting with signals/slots
    By gunhelstr in forum Qt Programming
    Replies: 1
    Last Post: 13th June 2006, 12:30

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.