create separate class for radiobutton icon
This commit is contained in:
parent
817717e628
commit
fbcc7b2bf7
|
@ -0,0 +1,21 @@
|
|||
#include "radiobutton_internal.h"
|
||||
#include <QPainter>
|
||||
|
||||
RadioButtonIcon::RadioButtonIcon(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
}
|
||||
|
||||
RadioButtonIcon::~RadioButtonIcon()
|
||||
{
|
||||
}
|
||||
|
||||
void RadioButtonIcon::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
Q_UNUSED(event)
|
||||
|
||||
QPainter painter(this);
|
||||
|
||||
painter.setPen(Qt::red);
|
||||
painter.drawRect(rect());
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef RADIOBUTTON_INTERNAL_H
|
||||
#define RADIOBUTTON_INTERNAL_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class RadioButtonIcon : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RadioButtonIcon(QWidget *parent = 0);
|
||||
~RadioButtonIcon();
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(RadioButtonIcon)
|
||||
};
|
||||
|
||||
#endif // RADIOBUTTON_INTERNAL_H
|
Loading…
Reference in New Issue