PhaseButton added

This commit is contained in:
marcus 2009-08-18 12:21:37 +02:00
parent f238b59935
commit 08a5338e9b
3 changed files with 135 additions and 16 deletions

View file

@ -0,0 +1,39 @@
#include "phasebutton.h"
#include <QPainter>
#include <QPen>
//
PhaseButton::PhaseButton(QIcon icon, QString name )
: QPushButton(icon,name)
{
}
//PhaseButton::PhaseButton( )
//: QPushButton()
//{
//
//}
void PhaseButton::update()
{
QPushButton::update();
}
void PhaseButton::paintEvent(QPaintEvent *event)
{
QPushButton::paintEvent(event);
if(isChecked())
{
QPainter painter(this);
int height = size().height();
int width = size().width();
QPen pen;
pen.setWidth(3);
pen.setColor(QColor::fromRgb(180,0,0));
painter.setPen(pen);
painter.drawRect(3,3, width-7, height-7);
}
}
//

View file

@ -0,0 +1,16 @@
#ifndef PHASEBUTTON_H
#define PHASEBUTTON_H
//
#include <QPushButton>
//
class PhaseButton : public QPushButton
{
Q_OBJECT
public:
PhaseButton();
PhaseButton(QIcon, QString);
void update();
void paintEvent(QPaintEvent *event);
};
#endif