#include #include #include #include #include "enum.bactypes.h" #include "CharString.h" CharString::CharString(QWidget *parent, int db_id, int PropId, QString label, QGridLayout *layout, int row, int col) : Field(parent, db_id, PropId, BT_CHR_STR, label) { if(label != QString()) { this->lineEdit = new QLineEdit(parent); this->input = this->lineEdit; connect(this->input, SIGNAL(textChanged(const QString &)), this, SLOT(valueChanged(const QString &))); } else this->input = NULL; if(layout) { layout->addWidget(this->label, row, col, Qt::AlignRight); layout->addWidget(this->input, row, col + 1, Qt::AlignLeft); } this->value = QVariant(); } CharString::CharString(QWidget *parent, int db_id, int PropId, QString value, QString label, QGridLayout *layout, int row, int col) : Field(parent, db_id, PropId, BT_CHR_STR, label) { if(label != QString()) { this->lineEdit = new QLineEdit(value, parent); this->input = this->lineEdit; connect(this->input, SIGNAL(textChanged(const QString &)), this, SLOT(valueChanged(const QString &))); } else this->input = NULL; if(layout) { layout->addWidget(this->label, row, col, Qt::AlignRight); layout->addWidget(this->input, row, col + 1, Qt::AlignLeft); } this->value = value; } void CharString::SetValue(QVariant value) { this->value = value; this->lineEdit->setText(value.toString()); }