Re: list view item problem..
It's because of takeFirst() method. It takes the first element so it means it removes it from the list. Let's say you have 20 items at the begining then:
1. first loop pass:
i = 0,
size() = 20
2. second loop pass:
i = 1
size() = 19
...
10.
i = 9;
size() = 11;
11.
i = 10;
size() = 10
end of loop.
Use .at(i) instead.
Re: list view item problem..
Thanks
I read the documents....Your way is exactly correct..
But for me ...,Qt showing no member named as at ,if i use list.at[i]..
here i descibe the full function.
Code:
void Widget
::DisplayList(QLinkedList<Returnables
::StatusUser*> list,
QString header
) {
Returnables::StatusUser *statusUser =NULL;
for(int i=0;i<=list.size();i++)
{
//QMessageBox::information(0,"",QString::number(i),QString::number(list.size()));
model->appendRow(item);
}
ui->listView_2->setModel(model);
for(int i=0;i<=list.size();i++)
{
statusUser = list.at(i);
//QMessageBox::information(0,"name",QString(list[i]));
t = new Tweet(statusUser->user.name,statusUser->status.text,statusUser->user.profileImageUrl);
model->item(i)->setSizeHint(t->size());
t->resize(ui->listView_2->size().width()+50, t->size().height());
ui->listView_2->setIndexWidget(model->item(i)->index(), t);
}
}
And also it printint the half tweets is same..
Re: list view item problem..
Sorry ..
Here i am using Qlinked list...It didn't support at member function.
Re: list view item problem..
Hi
I don't know how solve this issue...
In API they have used the linked list..
please help me
Re: list view item problem..
Hi Friends ..
Still i am struggling with listview items....
please help us