Results 1 to 3 of 3

Thread: how to sync a QTreeWidget and a QListWidget?

  1. #1
    Join Date
    Sep 2008
    Posts
    23
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Question how to sync a QTreeWidget and a QListWidget?

    hi, there

    I have a qtreewidget and a qlistwidget in a form. The qtreewidget accepts drop operation. Once a item dropped on a node, I need to record the item's info and the node info on the qlistwidget. The qtreewidgetitem won't be changed on drop operation (let's just count the times of each node being dropped).

    What I need to know is: how can the qlistwidget know if something is dropped in the qtreewidget? I know how to implement the drop operation in the qtreewidget but don't know how to pass that info to qlistwidget.

    I basically follow the tutorial here http://sector.ynet.sk/qt4-tutorial/dnd.html.
    The qtreewidget promote to myqtreewidget class where the drop operation is implemented.

    Thanks for your comments.

    zl2k
    Last edited by zl2k; 3rd September 2008 at 23:28.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to sync a QTreeWidget and a QListWidget?

    Quote Originally Posted by zl2k View Post
    I know how to implement the drop operation in the qtreewidget but don't know how to pass that info to qlistwidget.
    You can make tree widget emit a signal and connect it to a slot in list widget. Of course that means you have to subclass both widgets.

  3. #3
    Join Date
    Sep 2008
    Posts
    23
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: how to sync a QTreeWidget and a QListWidget?

    Thanks, I got it.

Similar Threads

  1. Drag from QTreeWidget and drop in QListWidget
    By WXNSNW in forum Qt Programming
    Replies: 1
    Last Post: 25th August 2008, 01:15
  2. resizing a QTreeWidget
    By drhex in forum Qt Programming
    Replies: 6
    Last Post: 27th October 2006, 23:32
  3. QTreeWidget & QListWidget different selection
    By munna in forum Qt Programming
    Replies: 9
    Last Post: 21st July 2006, 07:50

Tags for this Thread

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.