ResourcesBrowser: improved item filtering

Filter line-edit is now placed above actual tree view and has been
decorated with a small icon as well as a status label, displaying the
number of filtered and total number of items.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
This commit is contained in:
Tobias Doerffel
2009-06-04 11:58:48 +02:00
parent 1ee8d38ca7
commit 14fef9152c
6 changed files with 79 additions and 4 deletions

View File

@@ -29,6 +29,7 @@
#include "side_bar_widget.h"
class QAction;
class QLabel;
class ResourcesItem;
class ResourcesTreeModel;
class ResourcesTreeView;
@@ -58,6 +59,7 @@ public:
private slots:
void showContextMenu( const QPoint & _pos );
void updateFilterStatus();
private:
@@ -68,6 +70,8 @@ private:
ResourcesTreeModel * m_treeModel;
ResourcesTreeView * m_treeView;
QLabel * m_filterStatusLabel;
} ;

View File

@@ -159,6 +159,11 @@ public:
return m_treeItem;
}
const ResourcesTreeItem * treeItem( void ) const
{
return m_treeItem;
}
const QDateTime & lastMod( void ) const
{
return m_lastMod;

View File

@@ -75,6 +75,9 @@ public:
return treeItem( _idx )->item();
}
int totalItems() const;
int shownItems() const;
private:
bool filterItems( ResourcesTreeItem * _item,