2014-05-17 15:23:48 +01:00
|
|
|
#pragma once
|
|
|
|
#include <QIcon>
|
2023-08-02 17:35:35 +01:00
|
|
|
#include <QWidget>
|
2014-05-17 15:23:48 +01:00
|
|
|
|
|
|
|
class QStyleOption;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is a trivial widget that paints a QIcon of the specified size.
|
|
|
|
*/
|
2023-08-02 17:35:35 +01:00
|
|
|
class IconLabel : public QWidget {
|
2018-07-15 13:51:05 +01:00
|
|
|
Q_OBJECT
|
2014-05-17 15:23:48 +01:00
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
public:
|
2018-07-15 13:51:05 +01:00
|
|
|
/// Create a line separator. orientation is the orientation of the line.
|
2023-08-02 17:35:35 +01:00
|
|
|
explicit IconLabel(QWidget* parent, QIcon icon, QSize size);
|
2014-05-17 15:23:48 +01:00
|
|
|
|
2018-07-15 13:51:05 +01:00
|
|
|
virtual QSize sizeHint() const;
|
2023-08-02 17:35:35 +01:00
|
|
|
virtual void paintEvent(QPaintEvent*);
|
2014-05-17 15:23:48 +01:00
|
|
|
|
2018-07-15 13:51:05 +01:00
|
|
|
void setIcon(QIcon icon);
|
2014-05-17 15:23:48 +01:00
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
private:
|
2018-07-15 13:51:05 +01:00
|
|
|
QSize m_size;
|
|
|
|
QIcon m_icon;
|
2014-05-17 15:23:48 +01:00
|
|
|
};
|