Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 5

Qt-interest Archive, March 2002
Prevent initial sorting


Message 1 in thread

Hi all,

I want to prevent the initial sorting of the items , when adding to a list
view.
I have given setsorting (-1) will not get the results.

Anybody knows , your help is appreciable .

regards
Sajeesh


Message 2 in thread

When you are adding the QListViewItems are you using the constructor that
allows you to specify that this item is after another specified
QListViewItem? 
i.e. QListViewItem ( QListView * parent, QListViewItem * after ).

this (and setting the sorting to -1) is what I had to do with a similar
problem.

Hope this helps

This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.


Message 3 in thread

Also observe that after==NULL means that the item is added to the 
beginning of the list, not the end as you would expect. I usually use 
this construct to create a list.

QListViewItem *last=NULL;
while({whatever data source}) {
  last=new QListViewItem({listViewPtr},last);
  {whatever more init of last}
}

This will create a list with the order you create the items.

/Mauritz

Gould, Simon wrote:

>When you are adding the QListViewItems are you using the constructor that
>allows you to specify that this item is after another specified
>QListViewItem? 
>i.e. QListViewItem ( QListView * parent, QListViewItem * after ).
>
>this (and setting the sorting to -1) is what I had to do with a similar
>problem.
>
>Hope this helps
>
>This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.
>
>--
>List archive and information: http://qt-interest.trolltech.com
>