45 #include <QPushButton> 46 #include <QVBoxLayout> 47 #include <QScrollArea> 52 #include "scene/elementInput.hh" 54 #include "configDialog.hh" 55 #include "configValue.hh" 71 QVBoxLayout *vL =
new QVBoxLayout;
72 QVBoxLayout *configL =
new QVBoxLayout;
76 QHBoxLayout *nameL =
new QHBoxLayout;
77 QLabel *l =
new QLabel(tr(
"Element name:"));
78 name_ =
new QLineEdit;
79 name_->setText (_name);
81 nameL->addWidget (name_);
82 nameL->setStretchFactor(name_, 1);
84 vL->addLayout (nameL);
97 if (_inputs.size () > 1)
98 configL->addWidget (v->group_);
100 vL->addWidget (v->group_);
105 configL->addStretch(1);
107 QPushButton *ok =
new QPushButton (
"OK");
108 QPushButton *cancel =
new QPushButton (
"Cancel");
110 connect (ok, SIGNAL (pressed ()),
this, SLOT (ok ()));
111 connect (cancel, SIGNAL (pressed ()),
this, SLOT (reject ()));
113 QHBoxLayout *buttonL =
new QHBoxLayout;
114 buttonL->addStretch();
115 buttonL->addWidget (ok);
116 buttonL->addWidget (cancel);
118 if (_inputs.size () > 1)
120 QWidget *sW =
new QWidget;
121 sW->setLayout (configL);
122 QScrollArea *sA =
new QScrollArea;
124 sA->setWidgetResizable (
true);
131 vL->addLayout (buttonL);
141 ConfigDialog::~ ConfigDialog()
153 return name_->text ();
162 void VSI::ConfigDialog::ok ()
166 if (!v->constant_ || v->constant_->isChecked ())
167 v->input_->
set (
true);
169 v->input_->
set (
false);
171 if (v->forceAskUser_ && v->forceAskUser_->isChecked ())
void set(bool _set)
"Set" flag to mark input as set by user
ConfigDialog(QVector< ElementInput *> _inputs, QString _name=QString(), QWidget *_parent=0)
Constructor.
void setValue(QString _value)
Set to a user value.
void setForceAsk(bool _set)
"ForceAsk" flag to mark an optional input for asking during script execution
virtual QString toValue()=0
Return the type configuration result to a string.
QString name()
return entered name