46 QGridLayout* gridLayout,
int row) :
49 CX_ASSERT(dataInterface->getAllowOnlyValuesInRange()==
false);
50 mData = dataInterface;
51 connect(mData.get(), SIGNAL(changed()),
this, SLOT(
setModified()));
53 QHBoxLayout* topLayout =
new QHBoxLayout;
54 topLayout->setMargin(0);
55 this->setLayout(topLayout);
57 mLabel =
new QLabel(
this);
58 mLabel->setText(mData->getDisplayName());
59 topLayout->addWidget(mLabel);
61 mLine =
new QLineEdit(
this);
62 topLayout->addWidget(mLine);
63 connect(mLine, SIGNAL(editingFinished()),
this, SLOT(editingFinished()));
67 gridLayout->addWidget(mLabel, row, 0);
68 gridLayout->addWidget(mLine, row, 1);
72 topLayout->addWidget(mLabel);
73 topLayout->addWidget(mLine, 1);
79 void LabeledLineEditWidget::editingFinished()
81 mData->setValue(mLine->text());
84 void LabeledLineEditWidget::prePaintEvent()
86 mLine->blockSignals(
true);
87 mLine->setReadOnly(mData->isReadOnly());
88 mLine->setText(mData->getValue());
89 mLine->setToolTip(mData->getHelp());
90 mLabel->setToolTip(mData->getHelp());
91 mLine->blockSignals(
false);
#define CX_ASSERT(statement)
boost::shared_ptr< class StringPropertyBase > StringPropertyBasePtr
Namespace for all CustusX production code.