X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetLineEdit.cpp;h=9c4a1b00f068fd36b0ef838b9320ca9f5a9f0a5b;hb=4d0ed9b6a97b4eacae1ce66dc6804c740751dfb9;hp=19771a66fd10deb7b3fb7e3c22d546d1725582f1;hpb=35a88fdd724349275bbff32b9596a44e7cd422e2;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp b/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp index 19771a66f..9c4a1b00f 100644 --- a/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp +++ b/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + /* * ModuleBase_WidgetLineEdit.cpp * @@ -15,7 +17,7 @@ #include -#include +#include #include #include #include @@ -29,16 +31,13 @@ ModuleBase_WidgetLineEdit::ModuleBase_WidgetLineEdit(QWidget* theParent, 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())); } @@ -47,7 +46,7 @@ ModuleBase_WidgetLineEdit::~ModuleBase_WidgetLineEdit() { } -bool ModuleBase_WidgetLineEdit::storeValue() const +bool ModuleBase_WidgetLineEdit::storeValueCustom() const { // A rare case when plugin was not loaded. if(!myFeature) @@ -75,11 +74,6 @@ bool ModuleBase_WidgetLineEdit::restoreValue() return true; } -QWidget* ModuleBase_WidgetLineEdit::getControl() const -{ - return myMainWidget; -} - QList ModuleBase_WidgetLineEdit::getControls() const { QList result;