#include #include #include #include #include #include "enum.bactypes.h" #include "BigCharString.h" BigCharString::BigCharString(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->textEdit = new QTextEdit(parent); this->input = this->textEdit; connect(this->textEdit, SIGNAL(textChanged()), this, SLOT(receiveTextChange())); } 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(); } BigCharString::BigCharString(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->textEdit = new QTextEdit(value, parent); this->input = this->textEdit; connect(this->textEdit, SIGNAL(textChanged()), this, SLOT(receiveTextChange())); } 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 BigCharString::receiveTextChange() { valueChanged(this->textEdit->toPlainText()); } void BigCharString::SetValue(QVariant value) { this->value = value; this->textEdit->setPlainText(value.toString()); }