+//! This ProxyModel can be used on top of a NickModel in order to provide a sorted nicklist and to hide unused categories.
+class FilteredNickModel : public QSortFilterProxyModel {
+ Q_OBJECT
+
+ public:
+ FilteredNickModel(QObject *parent = 0);
+ virtual ~FilteredNickModel();
+
+ virtual void setSourceModel(QAbstractItemModel *model);
+
+ private slots:
+ void sourceRowsInserted(const QModelIndex &, int, int);
+ void sourceRowsRemoved(const QModelIndex &, int, int);
+
+ protected:
+ virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
+
+};
+