Mercurial > trustbridge
comparison ui/administratorwindow.cpp @ 348:e6aa82466420
Use the table item delegate for certificates and make the model editable.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 10 Apr 2014 14:14:56 +0200 |
parents | 4454a4dc73a3 |
children | 9ba7b4b4c1de |
comparison
equal
deleted
inserted
replaced
347:dde533ba4fcc | 348:e6aa82466420 |
---|---|
12 #include <QLabel> | 12 #include <QLabel> |
13 #include <QImage> | 13 #include <QImage> |
14 #include <QCheckBox> | 14 #include <QCheckBox> |
15 #include <QHeaderView> | 15 #include <QHeaderView> |
16 #include <QFileDialog> | 16 #include <QFileDialog> |
17 | |
18 #include "certificatetabledelegate.h" | |
17 | 19 |
18 AdministratorWindow::AdministratorWindow() { | 20 AdministratorWindow::AdministratorWindow() { |
19 createActions(); | 21 createActions(); |
20 createMenuBar(); | 22 createMenuBar(); |
21 createContent(); | 23 createContent(); |
59 | 61 |
60 // The certificate list | 62 // The certificate list |
61 QGroupBox *certBox = new QGroupBox(tr("Managed Certificates")); | 63 QGroupBox *certBox = new QGroupBox(tr("Managed Certificates")); |
62 certificateView = new QTableView; | 64 certificateView = new QTableView; |
63 certificateModel = new CertificateTabelModel(); | 65 certificateModel = new CertificateTabelModel(); |
66 CertificateTableDelegate *delegate = new CertificateTableDelegate(certificateView); | |
64 certificateView->setModel(certificateModel); | 67 certificateView->setModel(certificateModel); |
65 certificateView->setColumnWidth(0, 60); | 68 certificateView->setItemDelegate(delegate); |
69 certificateView->setColumnWidth(0, 50); | |
66 certificateView->setColumnWidth(2, 130); | 70 certificateView->setColumnWidth(2, 130); |
67 certificateView->setColumnWidth(3, 130); | 71 certificateView->setColumnWidth(3, 130); |
68 certificateView->setColumnWidth(4, 200); | 72 certificateView->setColumnWidth(4, 200); |
69 certificateView->setSelectionBehavior(QAbstractItemView::SelectRows); | 73 certificateView->setSelectionBehavior(QAbstractItemView::SelectRows); |
70 certificateView->verticalHeader()->setVisible(false); | 74 certificateView->verticalHeader()->setVisible(false); |