2016-04-14 13:47:27 +00:00
|
|
|
#include <QWidget>
|
|
|
|
#include <QPainter>
|
2016-03-19 08:32:49 +00:00
|
|
|
#include "textfield.h"
|
2016-04-14 14:11:41 +00:00
|
|
|
#include "style.h"
|
2016-04-14 13:47:27 +00:00
|
|
|
|
|
|
|
TextField::TextField(QWidget *parent)
|
2016-04-14 14:11:41 +00:00
|
|
|
: QLineEdit(parent)
|
2016-04-14 13:47:27 +00:00
|
|
|
{
|
2016-04-14 14:11:41 +00:00
|
|
|
setStyle(&Style::instance());
|
2016-04-14 13:47:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
TextField::~TextField()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void TextField::mousePressEvent(QMouseEvent *event)
|
|
|
|
{
|
2016-04-14 14:11:41 +00:00
|
|
|
QLineEdit::mousePressEvent(event);
|
2016-04-14 13:47:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TextField::mouseReleaseEvent(QMouseEvent *event)
|
|
|
|
{
|
2016-04-14 14:11:41 +00:00
|
|
|
QLineEdit::mouseReleaseEvent(event);
|
2016-04-14 13:47:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void TextField::paintEvent(QPaintEvent *event)
|
|
|
|
{
|
2016-04-14 14:11:41 +00:00
|
|
|
QLineEdit::paintEvent(event);
|
2016-04-14 13:47:27 +00:00
|
|
|
|
2016-04-14 14:11:41 +00:00
|
|
|
QPainter painter(this);
|
|
|
|
painter.drawRect(0, 0, 50, 50);
|
2016-04-14 13:47:27 +00:00
|
|
|
}
|