diff ui/administratorwindow.cpp @ 335:811eec4e1b99

Use a table view with the new certificate table model in administrator app.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 09 Apr 2014 12:44:44 +0200
parents de94c4ec22b1
children e3d6de930c90
line wrap: on
line diff
--- a/ui/administratorwindow.cpp	Wed Apr 09 12:43:40 2014 +0200
+++ b/ui/administratorwindow.cpp	Wed Apr 09 12:44:44 2014 +0200
@@ -12,6 +12,9 @@
 #include <QLabel>
 #include <QImage>
 #include <QCheckBox>
+#include <QHeaderView>
+
+#include "certificatetablemodel.h"
 
 AdministratorWindow::AdministratorWindow() {
     createActions();
@@ -57,8 +60,14 @@
 
     // The certificate list
     QGroupBox *certBox = new QGroupBox(tr("Managed Certificates"));
-    certificateList = new QListWidget();
-    certLayout->addWidget(certificateList);
+    certificateView = new QTableView;
+    certificateView->setModel(new CertificateTabelModel());
+    certificateView->setColumnWidth(0, 30);
+    certificateView->setColumnWidth(2, 130);
+    certificateView->setColumnWidth(3, 130);
+    certificateView->setColumnWidth(4, 200);
+
+    certLayout->addWidget(certificateView);
     certBox->setLayout(certLayout);
 
     // The header (icon, about text)
@@ -96,6 +105,8 @@
     // managed in the central widget.
     base->setLayout(mainLayout);
     setCentralWidget(base);
+    certificateView->horizontalHeader()->setSectionResizeMode(1,
+        QHeaderView::Stretch);
 }
 
 void AdministratorWindow::showSettings()

http://wald.intevation.org/projects/trustbridge/