Results 1 to 3 of 3

Thread: Drag and drop over scrollArea

  1. #1
    Join Date
    Jul 2013
    Posts
    27
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    11

    Default Drag and drop over scrollArea

    Hello friends,
    I have a QScrollArea which contains around 10 images(Qlabels). From the left hand side i can drag and drop in this area. But when i drop, i am not actually dropping on the scrollArea, but the labels itself. Because of that my Dropevent function in the scrollArea never gets called. How can i drag drop over these labels. Kindly let me know. Thank you.

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

    Default Re: Drag and drop over scrollArea

    Ignore the drag events from the child (labels)

    or you can have a filter installed on the scroll area to intercept the drag events entering the scroll area before it is delivered to the child labels

  3. The following user says thank you to aamer4yu for this useful post:

    akshaysulakhe (10th September 2013)

  4. #3
    Join Date
    Jul 2013
    Posts
    27
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    11

    Default Re: Drag and drop over scrollArea

    Hello aamer4yu,
    Think of the scroll area like the container and the labels as the content. There is no empty space in the container. So whenever i am dragging and dropping. The drop event will always show the parent widget as the labels(QWidget). I am not sure i can ignore them. The 2nd method you said looks promising. Can you tell me how i can intecept the drag events? Thank you for your time.

Similar Threads

  1. Replies: 0
    Last Post: 7th January 2012, 15:20
  2. Replies: 2
    Last Post: 13th October 2010, 21:51
  3. Replies: 3
    Last Post: 10th June 2010, 15:13
  4. Replies: 0
    Last Post: 4th May 2010, 10:24
  5. Drag and Drop (drop example)
    By din9 in forum Qt Programming
    Replies: 1
    Last Post: 23rd January 2006, 18:03

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
  •  
Qt is a trademark of The Qt Company.