Results 1 to 2 of 2

Thread: Drag and drop grid?

  1. #1
    Join Date
    Mar 2007
    Posts
    74
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Drag and drop grid?

    Hi,

    I am looking for the experts suggestions on how to best approach this
    implementation. I have a custom LED widget. This will be arranged in
    a grid as shown in the attached image. Using the left mouse click I
    want to be able to grab the Green LED widget and drag it to one of the
    other LED cells who would then turn Green.

    It would be nice to have the LEDs use some sort of existing containerism
    so that I can identify the drag destination without having to write too
    much position calculation/object identification code.

    Perhaps there is an applicable QT mechanism already in place?

    Many thanks!

    Mark
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Drag and drop grid?

    Take a look at drag&drop documentation. You'll need to reimplement mouseMoveEvent (and possibly mousePressEvent), dragEnterEvent and dropEvent for your LED widget.

Similar Threads

  1. Drag & drop with model/view (Qt4)
    By yogeshm02 in forum Qt Programming
    Replies: 16
    Last Post: 19th September 2011, 20:36
  2. Drag and Drop
    By allensr in forum Qt Programming
    Replies: 1
    Last Post: 11th December 2006, 20:50
  3. Replies: 7
    Last Post: 8th September 2006, 16:19
  4. Drag and drop outside the application
    By jpn in forum Newbie
    Replies: 7
    Last Post: 27th August 2006, 15:37
  5. Drag and drop revisited
    By Big Duck in forum Newbie
    Replies: 2
    Last Post: 30th June 2006, 16:41

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.