#include <QDebug>
#include "my_line_edit.h"

MyLineEdit::MyLineEdit(QWidget *parent)
    :QLineEdit(parent)
{
    this->setStyleSheet("QLineEdit{background:transparent;}");
}

void MyLineEdit::focusInEvent(QFocusEvent *e)
{
    m_str.clear();
    m_str = this->text();
    QLineEdit::focusInEvent(e);
}

void MyLineEdit::focusOutEvent(QFocusEvent *e)
{
    this->setText(m_str);
    emit restoreWin();
    QLineEdit::focusOutEvent(e);
}
