- QGroupBox* GroupC1 = new QGroupBox( this, "GroupC1" );
- GroupC1->setColumnLayout(0, Qt::Vertical );
- GroupC1->layout()->setSpacing( 0 );
- GroupC1->layout()->setMargin( 0 );
- QGridLayout* GroupC1Layout = new QGridLayout( GroupC1->layout() );
- GroupC1Layout->setAlignment( Qt::AlignTop );
- GroupC1Layout->setSpacing( 6 );
- GroupC1Layout->setMargin( 11 );
- /* Label */
- /* aTitle1 : text prompt on left of edit line */
- myTextLabel = new QLabel( GroupC1, "TextLabel" );
- GroupC1Layout->addWidget( myTextLabel, 0, 0 );
- /* Spin box */
- if ( isDouble ) {
- myIntSpin = 0;
- myDblSpin = new QAD_SpinBoxDbl( GroupC1 );
- myDblSpin->setPrecision( 12 );
- myDblSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) );
- myDblSpin->setMinimumSize( 150, 0 );
- GroupC1Layout->addWidget( myDblSpin, 0, 1 );
- }
- else {
- myDblSpin = 0;
- myIntSpin = new QSpinBox( GroupC1 );
- myIntSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) );
- myIntSpin->setMinimumSize( 150, 0 );
- GroupC1Layout->addWidget( myIntSpin, 0, 1 );
+ QGroupBox* GroupC1 = new QGroupBox(this, "GroupC1");
+ GroupC1->setColumnLayout(0, Qt::Vertical);
+ GroupC1->layout()->setSpacing(0);
+ GroupC1->layout()->setMargin(0);
+ QGridLayout* GroupC1Layout = new QGridLayout(GroupC1->layout());
+ GroupC1Layout->setAlignment(Qt::AlignTop);
+ GroupC1Layout->setSpacing(6);
+ GroupC1Layout->setMargin(11);
+ /* Spin boxes with labels */
+ list<SMESHGUI_aParameterPtr>::iterator paramIt = myParamList.begin();
+ for (int row = 0; paramIt != myParamList.end(); paramIt++ , row++)
+ {
+ SMESHGUI_aParameterPtr param = (*paramIt);
+ QLabel * label = new QLabel(GroupC1, "TextLabel");
+ GroupC1Layout->addWidget(label, row, 0);
+ label->setText(param->Label());
+ QWidget* aSpinWidget = param->CreateWidget( GroupC1 );
+ if (aSpinWidget) {
+ GroupC1Layout->addWidget(aSpinWidget, row, 1);
+ aSpinWidget->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
+ aSpinWidget->setMinimumSize(150, 0);
+
+ QString sig = param->sigValueChanged();
+ if( !sig.isEmpty() && param->GetType()!=SMESHGUI_aParameter::TABLE )
+ connect( aSpinWidget, sig.latin1(), this, SLOT( onValueChanged() ) );
+
+ param->InitializeWidget(aSpinWidget);
+ mySpinList.push_back(aSpinWidget);
+ myLabelList.push_back(label);
+ }