diff ui/certificateitemdelegate.cpp @ 372:6cc124e79066

Add save/load unselected and add role enumerator Explicitly naming the roles avoids confusion and makes the code more readable
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 15 Apr 2014 11:56:29 +0200
parents dd6a09d2699f
children 9e38a4bcd44e
line wrap: on
line diff
--- a/ui/certificateitemdelegate.cpp	Tue Apr 15 11:04:34 2014 +0200
+++ b/ui/certificateitemdelegate.cpp	Tue Apr 15 11:56:29 2014 +0200
@@ -1,6 +1,7 @@
 #include <QtWidgets>
 
 #include "certificate.h"
+#include "mainwindow.h"
 #include "certificateitemdelegate.h"
 
 void CertificateItemDelegate::paint(QPainter *painter,
@@ -8,7 +9,7 @@
 {
     // Save the current painter.
     painter->save();
-    int status = index.data(Qt::UserRole + 1).toInt();
+    int status = index.data(MainWindow::StatusRole).toInt();
     if (status == 0) {
         // This status is not known, so draw the default item.
         QStyledItemDelegate::paint(painter, option, index);

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