view ui/certificateitemwidget.h @ 1053:78798d3af8f0

Fixed doxygen build warnings.
author Emanuel Schuetze <emanuel@intevation.de>
date Tue, 09 Sep 2014 15:22:19 +0200
parents 9c4543128666
children 2b3526ef2d69
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 <QComboBox>

#include "certificate.h"
/** @brief A combo box that shows the text only in the popup
 *
 * The text shown is the data set as Qt::UserRole
 */
class IconOnlyTextPopupBox : public QComboBox
{
protected:
    virtual void showPopup();
    virtual void hidePopup();
};


class CertificateItemWidget : public QWidget
{
Q_OBJECT
public:
    CertificateItemWidget(
        QWidget *parent = 0,
        const Certificate &cert = Certificate(),
        bool state = false,
        bool editable = true,
        const QString& installLabel = QString(),
        const QString& removeLabel = QString());

    bool state();
    void setState(bool state);
    Certificate certificate();

private:
    void setupGUI();

    Certificate mCertificate;
    bool mState;
    bool mEditable;
    QLabel *mLabel;
    IconOnlyTextPopupBox *mComboBox;
    QString mInstallLabel;
    QString mRemoveLabel;

private slots:
    void currentStateChanged(int ndx);

signals:
    void stateChanged(bool state, const Certificate &cert);
};
#endif

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