Re: [PyQt] QTreeView and sorting

2010-11-18 Thread Di Zou
Sorry. I meant I am using a QTreeWidget and QTreeWidgetItems. From: Reinaldo de Carvalho To: Di Zou Cc: pyqt@riverbankcomputing.com Sent: Thu, November 18, 2010 9:22:37 AM Subject: Re: [PyQt] QTreeView and sorting On Thu, Nov 18, 2010 at 11:18 AM, Di Zou

Re: [PyQt] QTreeView and sorting

2010-11-18 Thread Hans Meine
Op den Middeweken 17 November 2010 Klock 17:42:20 hett dizou schreven: > I am using a QTreeView and I have sorting enabled. Sorting works great, but > I want one column to be sorted a specific way that isn't how Qt does it by > default. I took a look at QSortFilterProxyModel, but this class looks m

Re: [PyQt] QTreeView and sorting

2010-11-18 Thread Reinaldo de Carvalho
On Thu, Nov 18, 2010 at 11:18 AM, Di Zou wrote: > There is no QListViewItem, so I used QListWidgetItem. I cannot insert those > into my QTreeView though and I am not going to turn my QTreeView into a > QListView. > Sorry, QListViewItem is a QT3 object. -- Reinaldo de Carvalho http://korreio.sf.

Re: [PyQt] QTreeView and sorting

2010-11-18 Thread Reinaldo de Carvalho
On Thu, Nov 18, 2010 at 11:18 AM, Di Zou wrote: > There is no QListViewItem, so I used QListWidgetItem. I cannot insert those > into my QTreeView though and I am not going to turn my QTreeView into a > QListView. > You said 'I am using a QTreeView'. Check the first message. -- Reinaldo de Car

Re: [PyQt] QTreeView and sorting

2010-11-18 Thread Di Zou
9:07:13 AM Subject: Re: [PyQt] QTreeView and sorting I said 'QListViewItem' reimplemented as 'QListViewItemXX', but you must insert items with 'QListViewItemXX' on 'QTreeView'. -- Reinaldo de Carvalho http://korreio.sf.net http://python-cyrus.sf.net

Re: [PyQt] QTreeView and sorting

2010-11-18 Thread Reinaldo de Carvalho
On Thu, Nov 18, 2010 at 11:00 AM, dizou wrote: > > So this is what I did: > > class TreeWidget(QTreeWidgetItem): >    def __init__(self, parent=None): >        QTreeWidgetItem.__init__(self, parent) >    def key(self, col, asc): >        print col >        if col == 4: >            path = self.tex

Re: [PyQt] QTreeView and sorting

2010-11-18 Thread dizou
So this is what I did: class TreeWidget(QTreeWidgetItem): def __init__(self, parent=None): QTreeWidgetItem.__init__(self, parent) def key(self, col, asc): print col if col == 4: path = self.text(col).latin1() if path is not None and path.fin

Re: [PyQt] QTreeView and sorting

2010-11-17 Thread Reinaldo de Carvalho
On Wed, Nov 17, 2010 at 1:42 PM, dizou wrote: > > I am using a QTreeView and I have sorting enabled. Sorting works great, but I > want one column to be sorted a specific way that isn't how Qt does it by > default. I took a look at QSortFilterProxyModel, but this class looks more > like a way to so

[PyQt] QTreeView and sorting

2010-11-17 Thread dizou
I am using a QTreeView and I have sorting enabled. Sorting works great, but I want one column to be sorted a specific way that isn't how Qt does it by default. I took a look at QSortFilterProxyModel, but this class looks more like a way to sort and filter data before the data is displayed in the t