+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
/*
* ModuleBase_WidgetLineEdit.cpp
*
#include <Config_WidgetAPI.h>
-#include <QHBoxLayout>
+#include <QFormLayout>
#include <QLabel>
#include <QLineEdit>
#include <QObject>
const std::string& theParentId)
: ModuleBase_ModelWidget(theParent, theData, theParentId)
{
- myMainWidget = new QWidget(theParent);
- QHBoxLayout* aMainLay = new QHBoxLayout(myMainWidget);
+ QFormLayout* aMainLay = new QFormLayout(this);
ModuleBase_Tools::adjustMargins(aMainLay);
QString aTitle = QString::fromStdString(theData->widgetLabel());
- QLabel* aTitleLabel = new QLabel(aTitle, myMainWidget);
- aMainLay->addWidget(aTitleLabel);
- myLineEdit = new QLineEdit(myMainWidget);
- aMainLay->addWidget(myLineEdit);
+ myLineEdit = new QLineEdit(this);
myLineEdit->setMinimumHeight(20);
- myMainWidget->setLayout(aMainLay);
+ aMainLay->addRow(aTitle, myLineEdit);
+ this->setLayout(aMainLay);
connect(myLineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(onTextChanged()));
}
{
}
-bool ModuleBase_WidgetLineEdit::storeValue() const
+bool ModuleBase_WidgetLineEdit::storeValueCustom() const
{
// A rare case when plugin was not loaded.
if(!myFeature)
return true;
}
-QWidget* ModuleBase_WidgetLineEdit::getControl() const
-{
- return myMainWidget;
-}
-
QList<QWidget*> ModuleBase_WidgetLineEdit::getControls() const
{
QList<QWidget*> result;