Mercurial > trustbridge
changeset 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 | 36be67070dcb |
children | 26817025351f |
files | ui/CMakeLists.txt ui/administratorwindow.cpp ui/administratorwindow.h |
diffstat | 3 files changed, 16 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ui/CMakeLists.txt Wed Apr 09 12:43:40 2014 +0200 +++ b/ui/CMakeLists.txt Wed Apr 09 12:44:44 2014 +0200 @@ -30,6 +30,7 @@ set(ADMINSTRATOR_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/administrator.cpp ${CMAKE_CURRENT_SOURCE_DIR}/administratorwindow.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/certificatetablemodel.cpp ${CERTIFICATELIST_SOURCES} )
--- 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()
--- a/ui/administratorwindow.h Wed Apr 09 12:43:40 2014 +0200 +++ b/ui/administratorwindow.h Wed Apr 09 12:44:44 2014 +0200 @@ -9,7 +9,7 @@ #include <QMainWindow> #include <QSettings> #include <QMenuBar> -#include <QListWidget> +#include <QTableView> #include <QPushButton> class QMenu; @@ -37,7 +37,7 @@ QMenuBar *menuBar; - QListWidget *certificateList; + QTableView *certificateView; QPushButton *saveButton; QPushButton *loadButton; QPushButton *addButton;