changeset 274:90432cb1f374

Added a separator to certificate list to demonstrate how it works.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 02 Apr 2014 13:38:56 +0200
parents b6c2fa8457b6
children e265431f3e92
files ui/mainwindow.cpp
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ui/mainwindow.cpp	Wed Apr 02 13:38:10 2014 +0200
+++ b/ui/mainwindow.cpp	Wed Apr 02 13:38:56 2014 +0200
@@ -32,6 +32,7 @@
 #include "aboutdialog.h"
 #include "statusdialog.h"
 #include "certificateitemdelegate.h"
+#include "separatoritemdelegate.h"
 
 MainWindow::MainWindow() {
     createActions();
@@ -320,6 +321,7 @@
             continue;
         }
         QListWidgetItem* item = new QListWidgetItem(cert.shortDescription());
+        SeparatorItemDelegate *separator = new SeparatorItemDelegate();
         item->setData(Qt::UserRole, cert.details());
         if (cert.isInstallCert()) {
             // This if statements is for testing! @TODO Remove this!
@@ -333,6 +335,12 @@
                 item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
                 item->setCheckState(Qt::Checked);
             }
+            if (i == 3) {
+                QListWidgetItem *sep = new QListWidgetItem("New certificates");
+                certificateList->setItemDelegateForRow(i, separator);
+                certificateList->addItem(sep);
+                i++;
+            }
         }
         else {
             // This if statements is for testing! @TODO Remove this!

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