#include "nmGUIComponentLineEdit.h" #include "nmDataAttribute.h" #include #include #include #include Q_DECLARE_METATYPE(int *) Q_DECLARE_METATYPE(double *) Q_DECLARE_METATYPE(QString *) nmGUIComponentLineEdit::nmGUIComponentLineEdit(nmDataAttribute* pOriginValue, bool enable, QWidget *parent) : nmGUIComponentBase(pOriginValue, enable, parent) { this->initUI(); this->initInitValue(); this->setStyleSheet("{ background-color: red; }"); } void nmGUIComponentLineEdit::init() { this->initUI(); this->initInitValue(); } void nmGUIComponentLineEdit::setDisplayValue(double v) { double disp = nmDataAttribute::convertValue(v, m_baseUnit, m_currentUnit); QLineEdit* le = qobject_cast(m_pValueEdit); if (le) { le->setText(QString::number(disp, 'f', 3)); } }