changeset 433:2e5499fae159

Set sizeHint for certificate item delegates.
author Raimund Renkert <rrenkert@intevation.de>
date Tue, 22 Apr 2014 12:33:10 +0200
parents 16b5cd858571
children dbcc7740b9d8
files ui/certificateitemdelegate.cpp ui/certificateitemdelegate.h
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ui/certificateitemdelegate.cpp	Tue Apr 22 11:20:13 2014 +0200
+++ b/ui/certificateitemdelegate.cpp	Tue Apr 22 12:33:10 2014 +0200
@@ -96,3 +96,11 @@
     painter->drawText(rect.left(), rect.top(), rect.width(), rect.height(),
         Qt::AlignVCenter|Qt::AlignLeft, text, &rect);
 }
+
+QSize CertificateItemDelegate::sizeHint(const QStyleOptionViewItem &option,
+    const QModelIndex &index) const
+{
+    int width = option.rect.width() - 50;
+    int height = 25;
+    return QSize(width, height);
+}
--- a/ui/certificateitemdelegate.h	Tue Apr 22 11:20:13 2014 +0200
+++ b/ui/certificateitemdelegate.h	Tue Apr 22 12:33:10 2014 +0200
@@ -31,6 +31,8 @@
      */
     void paint(QPainter *painter, const QStyleOptionViewItem &option,
         const QModelIndex &index) const;
+    QSize sizeHint(const QStyleOptionViewItem &option,
+        const QModelIndex &index) const;
 
     /** @brief different roles for this tiem */
     enum ItemRole {

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