Re: a TreeModel that's sortable and filterable?
- From: Jamf <jamf gm gmail com>
- To: Murray Cumming <murrayc murrayc com>
- Cc: gtkmm-list gnome org
- Subject: Re: a TreeModel that's sortable and filterable?
- Date: Sun, 15 Jun 2008 13:20:45 +0200
Murray Cumming escribió:
On Sun, 2008-06-15 at 11:33 +0200, Jamf wrote:
Armin Burgmeier escribió:
TreeModelFilter and TreeModelSort have child models. So, if you have
some TreeModel A, and you want it sorted, then create a TreeModelSort
with A as child. If you want it both sorted and filtered, then create a
TreeModelFilter with a TreeModelSort as child (or vice versa).
Note that Gtk::ListStore and Gtk::TreeStore already support sorting
(since they implement Gtk::TreeSortable), so you don't even need
Gtk::TreeModelSort for them (unless you want to do things like showing a
sorted and an unsorted model in different views).
I have similar situation in my project.
If I put ListStore as the model in the treeview, then the sorting
properties work correctly, but when a TreeModelFilter (with the
liststore as child) is used as the model in the treeview, the
ListStore's sorting properties don't work
Can't you put the TreeModelFilter in a TreeModelSort?
Yes I can.
But if the ListStore implements TreeSortable, I don't know why I need
another TreeModelSort in top of the TreeModelFilter. Ie:
ListStore = Sorting properties
ListStore + TreeModelFilter = No Sorting properties, Filter properties
ListStore + TreeModelFilter + TreeModelSort = Sorting properties, Filter
properties.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]