Mercurial > trustbridge
comparison ui/administratorwindow.cpp @ 395:a63601810211
Resized administrator main window and columns.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Tue, 15 Apr 2014 16:44:55 +0200 |
parents | 7e0a188d6848 |
children | 26651cc0cc47 |
comparison
equal
deleted
inserted
replaced
394:7e0a188d6848 | 395:a63601810211 |
---|---|
26 certList.readList(path.toLocal8Bit()); | 26 certList.readList(path.toLocal8Bit()); |
27 createActions(); | 27 createActions(); |
28 createMenuBar(); | 28 createMenuBar(); |
29 createContent(); | 29 createContent(); |
30 loadCertificateTable(); | 30 loadCertificateTable(); |
31 resize(1110, 700); | |
31 } | 32 } |
32 | 33 |
33 void AdministratorWindow::createActions() | 34 void AdministratorWindow::createActions() |
34 { | 35 { |
35 } | 36 } |
71 certificateView = new QTableView; | 72 certificateView = new QTableView; |
72 certificateModel = new CertificateTabelModel(); | 73 certificateModel = new CertificateTabelModel(); |
73 CertificateTableDelegate *delegate = new CertificateTableDelegate(certificateView); | 74 CertificateTableDelegate *delegate = new CertificateTableDelegate(certificateView); |
74 certificateView->setModel(certificateModel); | 75 certificateView->setModel(certificateModel); |
75 certificateView->setItemDelegate(delegate); | 76 certificateView->setItemDelegate(delegate); |
76 certificateView->setColumnWidth(0, 50); | 77 certificateView->resizeColumnsToContents(); |
77 certificateView->setColumnWidth(2, 130); | 78 certificateView->setColumnWidth(0, 60); |
78 certificateView->setColumnWidth(3, 130); | |
79 certificateView->setColumnWidth(4, 200); | |
80 certificateView->setSelectionBehavior(QAbstractItemView::SelectRows); | 79 certificateView->setSelectionBehavior(QAbstractItemView::SelectRows); |
81 connect(certificateView, SIGNAL(clicked(const QModelIndex&)), this, | 80 connect(certificateView, SIGNAL(clicked(const QModelIndex&)), this, |
82 SLOT(clickedCertificate(const QModelIndex&))); | 81 SLOT(clickedCertificate(const QModelIndex&))); |
83 certificateView->verticalHeader()->setVisible(false); | 82 certificateView->verticalHeader()->setVisible(false); |
84 certLayout->addWidget(certificateView); | 83 certLayout->addWidget(certificateView); |
122 | 121 |
123 // QMainWindow allready has a layout. All child layouts and widgets are | 122 // QMainWindow allready has a layout. All child layouts and widgets are |
124 // managed in the central widget. | 123 // managed in the central widget. |
125 base->setLayout(mainLayout); | 124 base->setLayout(mainLayout); |
126 setCentralWidget(base); | 125 setCentralWidget(base); |
127 certificateView->horizontalHeader()->setSectionResizeMode(1, | |
128 QHeaderView::Stretch); | |
129 } | 126 } |
130 | 127 |
131 void AdministratorWindow::loadCertificateFile() | 128 void AdministratorWindow::loadCertificateFile() |
132 { | 129 { |
133 QString certFile = QFileDialog::getOpenFileName( | 130 QString certFile = QFileDialog::getOpenFileName( |
166 | 163 |
167 void AdministratorWindow::loadCertificateTable() { | 164 void AdministratorWindow::loadCertificateTable() { |
168 foreach(const Certificate &cert, certList.getCertificates()) { | 165 foreach(const Certificate &cert, certList.getCertificates()) { |
169 certificateModel->addCertificate(cert, true); | 166 certificateModel->addCertificate(cert, true); |
170 } | 167 } |
168 certificateView->resizeColumnsToContents(); | |
169 certificateView->setColumnWidth(0, 60); | |
171 } | 170 } |
172 | 171 |
173 void AdministratorWindow::addToCertificateTable(const QList<Certificate> &certs) | 172 void AdministratorWindow::addToCertificateTable(const QList<Certificate> &certs) |
174 { | 173 { |
175 foreach(const Certificate &cert, certs) { | 174 foreach(const Certificate &cert, certs) { |