PDA

View Full Version : How can I disable the QListView Sorting?



darpan
26th June 2006, 08:20
Hi,
I want to disable the QlisView's sorting, My requirement is to appear the text in the order as i enter in qlistview, i want to disable the default sorting of qlistview.

Thanks and Regards

jacek
26th June 2006, 13:17
Assuming that you use Qt3, you need this:
void QListView::setSorting ( int column, bool ascending = TRUE ) [virtual]
Sets the list view to be sorted by column column in ascending order if ascending is TRUE or descending order if it is FALSE.
If column is -1, sorting is disabled and the user cannot sort columns by clicking on the column headers. If column is larger than the number of columns the user must click on a column header to sort the list view.

darpan
27th June 2006, 11:08
Hi,

I am able to disable listview sorting but i also want to show items in the order as they inserted in the qlistview.

I want to make log report of my application. How can i show the items according to order as they inserted in the qlistview.

Thanks and Regards

eriwik
27th June 2006, 11:36
Use the after-argument when constructing the items:

QListViewItem::QListViewItem ( QListView * parent, QListViewItem * after )
Combine this with

QListViewItem * QListView::lastItem () const