Results 1 to 3 of 3

Thread: need help with my QTreeWidgetItem List

  1. #1
    Join Date
    Jan 2006
    Posts
    46
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default need help with my QTreeWidgetItem List

    hey all,
    Im using a QList <QTreeWidgetItem *> to get all the selected item in my qtree.
    Here is what its done:
    Qt Code:
    1. void Getmydistro::on_treeWidget_clicked()
    2. {
    3. QList <QTreeWidgetItem *> selection;
    4. selection << ui.treeWidget->selectedItems();
    5. for(int i=0;i<selection.size();i++)
    6. {
    7. selection.at(i);
    8. qDebug() << selection.at(i);
    9. }
    10. }
    To copy to clipboard, switch view to plain text mode 

    i would like to use some QTreeWidgetItem functions on each item of my QList such as "selection.at(i).text(0)" but it doesnt work as the QList contains pointers to each item. I couldnt figure out how to turn each item into an actual QTreeWidgetItem so I can apply QTreeWidgetItem´s functions to them. Any idea?

    thanx in advance

    Pat

  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: need help with my QTreeWidgetItem List

    Use -> instead of .

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

    patcito (6th July 2006)

  4. #3
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: need help with my QTreeWidgetItem List

    . .
    Last edited by Chicken Blood Machine; 6th July 2006 at 18:10.
    Save yourself some pain. Learn C++ before learning Qt.

Similar Threads

  1. list of list
    By quickNitin in forum Newbie
    Replies: 1
    Last Post: 3rd July 2006, 08:11
  2. delete items from list box
    By vvbkumar in forum Qt Programming
    Replies: 4
    Last Post: 23rd June 2006, 19:08
  3. From extends QTreeWidgetItem emit signal?
    By patrik08 in forum Qt Programming
    Replies: 4
    Last Post: 19th May 2006, 14:54
  4. enabling a QTreeWidgetItem as false
    By Kapil in forum Newbie
    Replies: 2
    Last Post: 3rd March 2006, 07:32
  5. QtCentre vs. Qt-Interest mailing list vs. QtForum?
    By brcain in forum General Discussion
    Replies: 4
    Last Post: 16th February 2006, 01:46

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.