aheinecke@404: /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik aheinecke@404: * Software engineering by Intevation GmbH aheinecke@404: * aheinecke@404: * This file is Free Software under the GNU GPL (v>=2) aheinecke@404: * and comes with ABSOLUTELY NO WARRANTY! aheinecke@404: * See LICENSE.txt for details. aheinecke@404: */ rrenkert@347: #ifndef CERTIFICATETABLEDELEGATE_H rrenkert@347: #define CERTIFICATETABLEDELEGATE_H rrenkert@347: /** rrenkert@347: * @file certificatetabledelegate.h rrenkert@347: * @brief Item delegate drawing custom certificate items in table views. rrenkert@347: * rrenkert@347: */ rrenkert@347: rrenkert@347: #include rrenkert@347: andre@1255: /** @brief Item delegate drawing custom certificate items in table views.*/ rrenkert@347: class CertificateTableDelegate : public QStyledItemDelegate rrenkert@347: { rrenkert@347: Q_OBJECT rrenkert@347: rrenkert@347: public: rrenkert@347: CertificateTableDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent){} rrenkert@347: rrenkert@347: /** rrenkert@347: * @brief Renders the delegate using the given painter and options. rrenkert@347: * rrenkert@347: * @param painter The painter to draw the item. rrenkert@347: * @param option The style options. rrenkert@347: * @param index The model index of the item to draw. rrenkert@347: */ rrenkert@347: void paint(QPainter *painter, const QStyleOptionViewItem &option, rrenkert@347: const QModelIndex &index) const; rrenkert@347: QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, rrenkert@347: const QModelIndex &index) const; rrenkert@347: rrenkert@347: void setEditorData(QWidget *editor, const QModelIndex &index) const; rrenkert@347: void setModelData(QWidget *editor, QAbstractItemModel *model, rrenkert@347: const QModelIndex &index) const; rrenkert@347: rrenkert@347: void updateEditorGeometry(QWidget *editor, rrenkert@347: const QStyleOptionViewItem &option, const QModelIndex &index) const; rrenkert@347: private: rrenkert@347: rrenkert@347: /** rrenkert@347: * @brief Draw the item using the given parameters. rrenkert@347: * emanuel@1053: * @param parent The parent widget. rrenkert@347: * @param option The style options. rrenkert@347: * @param index The model index of the item to draw. rrenkert@347: */ rrenkert@347: QWidget *drawComboBox(QWidget *parent, const QStyleOptionViewItem &option, rrenkert@347: const QModelIndex &index) const; rrenkert@347: }; rrenkert@347: #endif