MultiMC5/application/widgets/IconLabel.h

27 lines
510 B
C
Raw Normal View History

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