@@ -200,7 +200,10 @@ class QgsBrowserTreeFilterProxyModel : public QSortFilterProxyModel
200200 if ( mFilter == " " || !mModel ) return true ;
201201
202202 QModelIndex sourceIndex = mModel ->index ( sourceRow, 0 , sourceParent );
203- return filterAcceptsItem ( sourceIndex ) || filterAcceptsAncestor ( sourceIndex ) || filterAcceptsDescendant ( sourceIndex );
203+ // also look into the comment column
204+ QModelIndex commentIndex = mModel ->index ( sourceRow, 1 , sourceParent );
205+ return filterAcceptsItem ( sourceIndex ) || filterAcceptsAncestor ( sourceIndex ) || filterAcceptsDescendant ( sourceIndex ) ||
206+ filterAcceptsItem ( commentIndex ) || filterAcceptsAncestor ( commentIndex ) || filterAcceptsDescendant ( commentIndex );
204207 }
205208
206209 // returns true if at least one ancestor is accepted by filter
@@ -232,6 +235,11 @@ class QgsBrowserTreeFilterProxyModel : public QSortFilterProxyModel
232235 return true ;
233236 if ( filterAcceptsDescendant ( sourceChildIndex ) )
234237 return true ;
238+ sourceChildIndex = mModel ->index ( i, 1 , sourceIndex );
239+ if ( filterAcceptsItem ( sourceChildIndex ) )
240+ return true ;
241+ if ( filterAcceptsDescendant ( sourceChildIndex ) )
242+ return true ;
235243 }
236244 return false ;
237245 }
@@ -532,6 +540,7 @@ void QgsBrowserDockWidget::showEvent( QShowEvent * e )
532540 // provide a horizontal scroll bar instead of using ellipse (...) for longer items
533541 mBrowserView ->setTextElideMode ( Qt::ElideNone );
534542 mBrowserView ->header ()->setResizeMode ( 0 , QHeaderView::ResizeToContents );
543+ mBrowserView ->header ()->setResizeMode ( 1 , QHeaderView::ResizeToContents );
535544 mBrowserView ->header ()->setStretchLastSection ( false );
536545
537546 // selectionModel is created when model is set on tree
0 commit comments