summaryrefslogtreecommitdiffstats
path: root/application/widgets/IconLabel.h
blob: 6d212c4cac282322a6b2ef78615f0f0b488e823e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once
#include <QWidget>
#include <QIcon>

class QStyleOption;

/**
 * This is a trivial widget that paints a QIcon of the specified size.
 */
class IconLabel : public QWidget
{
    Q_OBJECT

public:
    /// Create a line separator. orientation is the orientation of the line.
    explicit IconLabel(QWidget *parent, QIcon icon, QSize size);

    virtual QSize sizeHint() const;
    virtual void paintEvent(QPaintEvent *);

    void setIcon(QIcon icon);

private:
    QSize m_size;
    QIcon m_icon;
};