2014-05-17 19:53:48 +05:30
|
|
|
#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
|
|
|
|
{
|
2018-07-15 18:21:05 +05:30
|
|
|
Q_OBJECT
|
2014-05-17 19:53:48 +05:30
|
|
|
|
|
|
|
public:
|
2018-07-15 18:21:05 +05:30
|
|
|
/// Create a line separator. orientation is the orientation of the line.
|
|
|
|
explicit IconLabel(QWidget *parent, QIcon icon, QSize size);
|
2014-05-17 19:53:48 +05:30
|
|
|
|
2018-07-15 18:21:05 +05:30
|
|
|
virtual QSize sizeHint() const;
|
|
|
|
virtual void paintEvent(QPaintEvent *);
|
2014-05-17 19:53:48 +05:30
|
|
|
|
2018-07-15 18:21:05 +05:30
|
|
|
void setIcon(QIcon icon);
|
2014-05-17 19:53:48 +05:30
|
|
|
|
|
|
|
private:
|
2018-07-15 18:21:05 +05:30
|
|
|
QSize m_size;
|
|
|
|
QIcon m_icon;
|
2014-05-17 19:53:48 +05:30
|
|
|
};
|