sortOrder/setSortOrder property
svn path=/trunk/KDE/kdebase/runtime/; revision=1190489
This commit is contained in:
parent
540606d0ed
commit
a84b230ddc
@ -83,6 +83,7 @@ void DataModel::setSortRole(const QString &role)
|
||||
{
|
||||
QSortFilterProxyModel::setSortRole(m_internalDataModel->roleNameToId(role));
|
||||
m_sortRole = role;
|
||||
sort(0, sortOrder());
|
||||
}
|
||||
|
||||
QString DataModel::sortRole() const
|
||||
@ -90,6 +91,12 @@ QString DataModel::sortRole() const
|
||||
return m_sortRole;
|
||||
}
|
||||
|
||||
void DataModel::setSortOrder(const Qt::SortOrder order)
|
||||
{
|
||||
sort(0, order);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
InternalDataModel::InternalDataModel(DataModel* parent)
|
||||
|
@ -41,6 +41,7 @@ class DataModel : public QSortFilterProxyModel
|
||||
Q_PROPERTY(QString filterRegExp READ filterRegExp WRITE setFilterRegExp)
|
||||
Q_PROPERTY(QString filterRole READ filterRole WRITE setFilterRole)
|
||||
Q_PROPERTY(QString sortRole READ sortRole WRITE setSortRole)
|
||||
Q_PROPERTY(Qt::SortOrder sortOrder READ sortOrder WRITE setSortOrder)
|
||||
|
||||
friend class InternalDataModel;
|
||||
|
||||
@ -63,6 +64,8 @@ public:
|
||||
void setSortRole(const QString &role);
|
||||
QString sortRole() const;
|
||||
|
||||
void setSortOrder(const Qt::SortOrder order);
|
||||
|
||||
private:
|
||||
InternalDataModel *m_internalDataModel;
|
||||
QString m_filterRole;
|
||||
|
Loading…
Reference in New Issue
Block a user