#include "LineEditWidget.h"
#include <QRegExpValidator>

const QString LineEditWidget::type = "LineEdit";

LineEditWidget::LineEditWidget(QWidget *parent)
    :QLineEdit(parent)
{
}

QVariant LineEditWidget::getValue() const
{
    return text().trimmed();
}

void LineEditWidget::setValue(const QVariant &value)
{
	if (value.type() != QMetaType::QString && value.toDouble() == 0)
		setText("");
	else 
		setText(value.toString());
}

bool LineEditWidget::isValueNull() const
{
    return text().trimmed().isEmpty();
}

void LineEditWidget::clearInput()
{
    clear();
}

