Mercurial > trustbridge
view ui/certificateitemdelegate.h @ 394:7e0a188d6848
Load the last certificate list from data dir on startup.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Tue, 15 Apr 2014 16:43:45 +0200 |
parents | 9e38a4bcd44e |
children | 17e1c8f37d72 |
line wrap: on
line source
#ifndef CERTIFICATELISTITEM_H #define CERTIFICATELISTITEM_H /** * @file certificateitemdelegate.h * @brief Item delegate drawing custom certificate items in list views. * */ #include <QStyledItemDelegate> class CertificateItemDelegate : public QStyledItemDelegate { Q_OBJECT public: CertificateItemDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent){} /** * @brief Renders the delegate using the given painter and options. * * @param painter The painter to draw the item. * @param option The style options. * @param index The model index of the item to draw. */ void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; /** @brief different roles for this tiem */ enum ItemRole { DetailsRole = Qt::UserRole, /* The certificate details for the window */ StatusRole, /* Certificate status */ B64LineRole /* The I:/R: <cert> line */ }; private: /** * @brief Draw the item using the given parameters. * * @param painter The painter to draw the item. * @param option The style options. * @param index The model index of the item to draw. * @param icon The icon to display. * @param font The font used to draw text. */ void drawItem(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, QIcon *icon, QFont *font) const; }; #endif