[Qt-interest] QTreeView, proxy model and expandable state

Scott Aron Bloom Scott.Bloom at sabgroup.com
Mon Apr 13 17:31:50 CEST 2009


It will really depend on what you implemented in your filterAcceptsRows
method.

Without seeing the guts of it, I have no idea how to help you.

Scott

-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Dmitry Baryshev
Sent: Monday, April 13, 2009 8:26 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] QTreeView, proxy model and expandable state

Hi.

I use QTreeView+QFileSystemModel. It seems to work fine, all directory
items have expanable flag ("+" on the left side). Now I've added
QSortFilterProxyModel with only one reimplemented method - "bool
SortFilterProxyModel::filterAcceptsRow(int row, const QModelIndex
&parent) const". Now all directory items in QTreeView lost its
expandable state - no '+' elements.
QTreeView::setItemsExpandable(true) doesn't help. I don't understand
the logic why filtering affects expandable states? Could you please
help me with this strange problem? Thanks!

--
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list