25 QGridLayout* gridLayout,
int row) :
28 CX_ASSERT(dataInterface->getAllowOnlyValuesInRange()==
false);
29 mData = dataInterface;
30 connect(mData.get(), SIGNAL(changed()),
this, SLOT(
setModified()));
32 QHBoxLayout* topLayout =
new QHBoxLayout;
33 topLayout->setMargin(0);
34 this->setLayout(topLayout);
36 mLabel =
new QLabel(
this);
37 mLabel->setText(mData->getDisplayName());
38 topLayout->addWidget(mLabel);
40 mLine =
new QLineEdit(
this);
41 topLayout->addWidget(mLine);
42 connect(mLine, SIGNAL(editingFinished()),
this, SLOT(editingFinished()));
46 gridLayout->addWidget(mLabel, row, 0);
47 gridLayout->addWidget(mLine, row, 1);
51 topLayout->addWidget(mLabel);
52 topLayout->addWidget(mLine, 1);
58 void LabeledLineEditWidget::editingFinished()
60 mData->setValue(mLine->text());
63 void LabeledLineEditWidget::prePaintEvent()
65 mLine->blockSignals(
true);
66 mLine->setReadOnly(mData->isReadOnly());
67 mLine->setText(mData->getValue());
68 mLine->setToolTip(mData->getHelp());
69 mLabel->setToolTip(mData->getHelp());
70 mLine->blockSignals(
false);