Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Switch and Toolbox refactored: common methods are extracted into base class
[modules/shaper.git]
/
src
/
ModuleBase
/
ModuleBase_WidgetLineEdit.cpp
diff --git
a/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp
b/src/ModuleBase/ModuleBase_WidgetLineEdit.cpp
index c25c3befade9d54df48ca1e9698bf33015123b75..9c4a1b00f068fd36b0ef838b9320ca9f5a9f0a5b 100644
(file)
--- a/
src/ModuleBase/ModuleBase_WidgetLineEdit.cpp
+++ b/
src/ModuleBase/ModuleBase_WidgetLineEdit.cpp
@@
-17,7
+17,7
@@
#include <Config_WidgetAPI.h>
#include <Config_WidgetAPI.h>
-#include <Q
HBox
Layout>
+#include <Q
Form
Layout>
#include <QLabel>
#include <QLineEdit>
#include <QObject>
#include <QLabel>
#include <QLineEdit>
#include <QObject>
@@
-31,16
+31,13
@@
ModuleBase_WidgetLineEdit::ModuleBase_WidgetLineEdit(QWidget* theParent,
const std::string& theParentId)
: ModuleBase_ModelWidget(theParent, theData, theParentId)
{
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());
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);
myLineEdit->setMinimumHeight(20);
- myMainWidget->setLayout(aMainLay);
+ aMainLay->addRow(aTitle, myLineEdit);
+ this->setLayout(aMainLay);
connect(myLineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(onTextChanged()));
}
connect(myLineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(onTextChanged()));
}
@@
-77,11
+74,6
@@
bool ModuleBase_WidgetLineEdit::restoreValue()
return true;
}
return true;
}
-QWidget* ModuleBase_WidgetLineEdit::getControl() const
-{
- return myMainWidget;
-}
-
QList<QWidget*> ModuleBase_WidgetLineEdit::getControls() const
{
QList<QWidget*> result;
QList<QWidget*> ModuleBase_WidgetLineEdit::getControls() const
{
QList<QWidget*> result;