Results 1 to 5 of 5

Thread: Drag and drop between QListWidget's

  1. #1
    Join Date
    Jan 2008
    Location
    Brasil
    Posts
    131
    Thanks
    18
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Drag and drop between QListWidget's

    Hi friends,

    I need guidance to do the drag and drop between two QListWidget designed in the designer. By dragging an item of the first QListWidget for the second, should be checked if this item already exists in this second QListWidget. If it does, it is removed from the first and added the second.

    Thanks,

    Marcelo Estanislau
    Brazil/RS

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

    Default Re: Drag and drop between QListWidget's

    What did you already try?

  3. #3
    Join Date
    Jan 2008
    Location
    Brasil
    Posts
    131
    Thanks
    18
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Drag and drop between QListWidget's

    Thanks for reply, wisota...

    I created a form in the designer with two QListWidget, with the properties to "true" to acceptDrops, dragEnabled, dragDropOverwriteMode and dragDropMode = QAbstractItemView: DragDrop. The big question is whether you do what I just drawing these QListWidget in designer and in writing any code, without having to write a class based on QListWidget and reimplementar functions of drag and drop.

    Thanks,

    Marcelo Estanislau

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

    Default Re: Drag and drop between QListWidget's

    You'll surely have to subclass QListWidget... The default implementation of QListWidget will do something close but not identical to what you want out of the box.

  5. #5
    Join Date
    Jun 2010
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Drag and drop between QListWidget's

    Hi ! I have the same requirement and I am very new to Qt. Can you elaborate on your point
    You'll surely have to subclass QListWidget...
    and give some more information as to what kind of I will have to write?

    Thank you.
    Last edited by rupeshbhurke; 17th February 2011 at 05:31. Reason: updated contents

Similar Threads

  1. Drag and Drop QTableWidget and QTableView
    By scorpion11 in forum Qt Programming
    Replies: 5
    Last Post: 8th April 2008, 10:33
  2. Problem with a cursor during Drag and Drop
    By mtrpoland in forum Qt Programming
    Replies: 1
    Last Post: 28th December 2007, 16:46
  3. Drag and Drop
    By allensr in forum Qt Programming
    Replies: 1
    Last Post: 11th December 2006, 21:50
  4. Replies: 7
    Last Post: 8th September 2006, 17:19
  5. Drag and drop revisited
    By Big Duck in forum Newbie
    Replies: 2
    Last Post: 30th June 2006, 17: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.