Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22

Thread: QGraphicsItem .. Scene .. View question?

  1. #21
    Join Date
    Jul 2009
    Posts
    22
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QGraphicsItem .. Scene .. View question?

    I think I've finally got it. For dragging and dropping....

    Case 1 No Item underneath.

    Scene dragMoveEvent does nothing
    Scene dragEnterEvent accept event, calls base method
    Scene dropEvent (adds a new Item to the scene), calls base method

    Case 2 Item underneath mouse

    Scene dragMoveEvent, sees there is an item and does ignore() and base method
    Scene dragEnterEvent, sees there is an item and does ignore() and base method
    Scene dropEvent, sees there is an item and does ignore() and base method

    Item dragMoveEvent, calls accept()
    Item dragEnterEvent, calls accept and base method
    Item dropEvent, calls base method.

    I now see the event in the item! wow! amazing! yay!

    Thank you for your help, now I can get on with some code logic!

    DB

  2. #22

    Default Re: QGraphicsItem .. Scene .. View question?

    Hi,
    Can you please help me with dropEvent for Scene?
    I cannot catch it...

    how can you setAcceptDrops for Scene?
    do I have to reimplement events for View also?

Similar Threads

  1. Scene vs. multiple views
    By lni in forum Qt Programming
    Replies: 16
    Last Post: 19th July 2022, 01:47
  2. Replies: 6
    Last Post: 8th June 2009, 21:44
  3. Model / View - Design Question
    By antarctic in forum Qt Programming
    Replies: 8
    Last Post: 8th June 2009, 07:39
  4. View, Scene, Item and thread??
    By dungsivn in forum Qt Programming
    Replies: 5
    Last Post: 20th August 2008, 19:21
  5. Deleting a scene from QGraphicsItem mouseEvent
    By JonathanForQT4 in forum Qt Programming
    Replies: 5
    Last Post: 10th April 2007, 11:27

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.