Update the view when the sorting role changes.

svn path=/trunk/KDE/kdebase/apps/; revision=677356
This commit is contained in:
Rafael Fernández López 2007-06-19 00:24:37 +00:00
parent b6aecc5b0f
commit 15d26d141e
2 changed files with 9 additions and 0 deletions

View file

@ -34,6 +34,8 @@ void KSortFilterProxyModel::sort(int column, Qt::SortOrder order)
QSortFilterProxyModel::sort(column, order);
m_sortOrder = order;
emit sortingRoleChanged();
}
Qt::SortOrder KSortFilterProxyModel::sortOrder() const
@ -46,3 +48,5 @@ bool KSortFilterProxyModel::lessThanCategoryPurpose(const QModelIndex &left,
{
return lessThan(left, right);
}
#include "ksortfilterproxymodel.moc"

View file

@ -28,6 +28,8 @@
class LIBDOLPHINPRIVATE_EXPORT KSortFilterProxyModel
: public QSortFilterProxyModel
{
Q_OBJECT
public:
KSortFilterProxyModel(QObject *parent = 0);
~KSortFilterProxyModel();
@ -42,6 +44,9 @@ public:
virtual bool lessThanCategoryPurpose(const QModelIndex &left,
const QModelIndex &right) const;
Q_SIGNALS:
void sortingRoleChanged();
private:
Qt::SortOrder m_sortOrder;
};