#include "knop.h"
#include "bc.h"
#include <QVariant>
#include <QLineEdit>
#include <QPushButton>
#include <QString>
#include <QApplication>
#include <QMessageBox>
#include <QTimer>
{
setMaximumSize
( QSize( 50,
50 ) );
label
= new QLabel("label",
this);
label
->setGeometry
( QRect( 0,
0,
50,
50 ) );
label->setText("");
but
->setGeometry
( QRect( 0,
0,
50,
50 ) );
but->setCheckable(true);
but
->setFont
(QFont("Bitstream Vera Sans",
22,
QFont::Bold));
but->setFlat(true);
e
->setGeometry
( QRect( 5,
5,
40,
10 ) );
QFont e_font
( e
->font
() );
e_font.setPointSize( 10 );
e->setFont( e_font );
e->setFrame( FALSE );
resize
( QSize(50,
50).
expandedTo(minimumSizeHint
()) );
connect( but, SIGNAL(clicked()), SLOT(butClick()) );
init();
}
knop::~knop(){}
void knop::init()
{
pWit.load(progPath + "include/knopWit.png");
pRood.load(progPath + "include/knopRood.png");
pGroen.load(progPath + "include/knopGroen.png");
label->setPixmap(pWit);
but->setPalette(palWit);
e->setPalette(palWit);
}
{
but->setText(num);
current = num;
e->setText("");
}
void knop::butClick()
{
bC* bC1 = new bC(knopRij,knopCol);
}
void knop::unClick()
{
but->setChecked(false);
but->setPalette(palWit);
e->setPalette(palWit);
}
{
QTimer::singleShot(2000,
this,
SLOT(terug
()));
but->setText(hoort);
but->setPalette(palGroen);
e->setPalette(palGroen);
}
void knop::terug()
{
but->setText(current);
but->setPalette(palWit);
e->setPalette(palWit);
}
void knop::setRood()
{
but->setPalette(palRood);
e->setPalette(palRood);
QTimer::singleShot(5000,
this,
SLOT(terug
()));
}
void knop::setGroen()
{
but->setPalette(palGroen);
e->setPalette(palGroen);
QTimer::singleShot(5000,
this,
SLOT(terug
()));
}
void knop::clearEdit()
{
e->setText("");
}