Results 1 to 2 of 2

Thread: list view displaying same item value...

  1. #1
    Join Date
    May 2009
    Posts
    129

    Default list view displaying same item value...

    Hi..

    My listview is displaying same item value...

    code..
    Qt Code:
    1. model = new QStandardItemModel(this);
    2. for(int i=0;i<list.size();i++)
    3. {
    4.  
    5. model->appendRow(item);
    6. }
    7. ui->listView_4->setModel(model);
    8. static int a = list.size();
    9. for(int i=0;i<a;i++)
    10. {
    11.  
    12. statusUser = list.takeFirst();
    13. t = new Tweet(statusUser->user.name,statusUser->status.text,statusUser->user.profileImageUrl);
    14. model->item(i)->setSizeHint(t->size());
    15. t->resize(ui->listView_4->size().width()+50, t->size().height());
    16. ui->listView_4->setIndexWidget(model->item(i)->index(), t);
    17.  
    18. }
    To copy to clipboard, switch view to plain text mode 

    previously i gave for second for loop size is list.size(),instead of k values...Now i corrected that issue ..But listview showing same item value only through out listview....

    please tell the way to avoid of displaying same item values..

    Thanks

    Addu

  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: list view displaying same item value...

    What do you mean by "same item values"? From what I see you are displaying widgets, not items... of course I can repeat myself (again) that you should use QScrollArea but I guess you already know that...
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. list view item problem..
    By addu in forum Qt Programming
    Replies: 5
    Last Post: 29th May 2009, 11:26
  2. multi-select editing in an item view
    By chezifresh in forum Qt Programming
    Replies: 0
    Last Post: 4th February 2009, 02:14
  3. View, Scene, Item and thread??
    By dungsivn in forum Qt Programming
    Replies: 5
    Last Post: 20th August 2008, 19:21
  4. list of custom item views?
    By Beluvius in forum Qt Programming
    Replies: 1
    Last Post: 29th March 2008, 06:43
  5. make QTableView work as a multi-column list view
    By wesley in forum Qt Programming
    Replies: 1
    Last Post: 11th March 2008, 14:43

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.