Results 1 to 2 of 2

Thread: list view displaying same item value...

  1. #1
    Join Date
    May 2009

    Default list view displaying same item value...


    My listview is displaying same item value...

    Qt Code:
    1. model = new QStandardItemModel(this);
    2. for(int i=0;i<list.size();i++)
    3. {
    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. {
    12. statusUser = list.takeFirst();
    13. t = new Tweet(statusUser->,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);
    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..



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

    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


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.