Mercurial > trustbridge
changeset 398:9e6a2c2033ed
Enable sorting in certifacte table view.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 16 Apr 2014 10:00:17 +0200 |
parents | 8752aae8aad8 |
children | 55cbe0a482ce |
files | ui/administratorwindow.cpp |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ui/administratorwindow.cpp Tue Apr 15 16:46:13 2014 +0200 +++ b/ui/administratorwindow.cpp Wed Apr 16 10:00:17 2014 +0200 @@ -15,6 +15,7 @@ #include <QHeaderView> #include <QFileDialog> #include <QStandardPaths> +#include <QSortFilterProxyModel> #include "certificatetabledelegate.h" #include "createinstallerdialog.h" @@ -71,8 +72,10 @@ QGroupBox *certBox = new QGroupBox(tr("Managed Certificates")); certificateView = new QTableView; certificateModel = new CertificateTabelModel(); + QSortFilterProxyModel *filterModel = new QSortFilterProxyModel(this); + filterModel->setSourceModel(certificateModel); CertificateTableDelegate *delegate = new CertificateTableDelegate(certificateView); - certificateView->setModel(certificateModel); + certificateView->setModel(filterModel); certificateView->setItemDelegate(delegate); certificateView->resizeColumnsToContents(); certificateView->setColumnWidth(0, 60); @@ -80,6 +83,7 @@ connect(certificateView, SIGNAL(clicked(const QModelIndex&)), this, SLOT(clickedCertificate(const QModelIndex&))); certificateView->verticalHeader()->setVisible(false); + certificateView->setSortingEnabled(true); certLayout->addWidget(certificateView); certBox->setLayout(certLayout);