Mercurial > trustbridge
view ui/certificateitemwidget.h @ 1294:f30c2b1ea0b6
(client-help) page 'arbeitsweise' updated.
author | Emanuel Schuetze <emanuel@intevation.de> |
---|---|
date | Mon, 29 Sep 2014 15:41:14 +0200 |
parents | d2b32c75efcf |
children |
line wrap: on
line source
/* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik * Software engineering by Intevation GmbH * * This file is Free Software under the GNU GPL (v>=2) * and comes with ABSOLUTELY NO WARRANTY! * See LICENSE.txt for details. */ #ifndef CERTIFICATELISTITEM_H #define CERTIFICATELISTITEM_H /** * @file certificateitemwidget.h * @brief Item delegate drawing custom certificate items in list views. * */ #include <QWidget> #include <QLabel> #include <QToolButton> #include "certificate.h" /** @brief A tool button that always looks as if it were unchecked. */ class CheckLessToolBtn : public QToolButton { void paintEvent(QPaintEvent * pe); }; /** @brief Item delegate drawing custom certificate items in list views.*/ class CertificateItemWidget : public QWidget { Q_OBJECT public: /** @brief ctor of the widget * * @param [in] parent the parent of the widget * @param [in] cert the certificate to hold. * @param [in] state wether or not the action of the certificate should be done. * @param [in] btn the button used to manage the state of the cert.*/ CertificateItemWidget( QWidget *parent = 0, const Certificate &cert = Certificate(), bool state = false, QToolButton * btn = NULL); bool state(); /** @brief set the state of the certificate. * * A false state means that the certificate action (install or remove) * should not be executed. * * @param [in] state the state of the certificate **/ void setState(bool state); /** @brief Obtain a copy of the certificate that is shown in the widget. * * @returns A copy of the hold certificate. **/ Certificate certificate(); private: void setupGUI(); Certificate mCertificate; bool mOriginalState; QToolButton *mButton; private slots: /** @brief called when the certificate state has been changed */ void currentStateChanged(bool state); /** @brief Used to open the native cert dialog of the certificate */ void showCertDlg(); signals: void stateChanged(bool state, const Certificate &cert); }; #endif