51 #include <QPushButton>
52 #include <QVBoxLayout>
53 #include <QScrollArea>
58 #include "scene/elementInput.hh"
60 #include "configDialog.hh"
61 #include "configValue.hh"
77 QVBoxLayout *vL =
new QVBoxLayout;
78 QVBoxLayout *configL =
new QVBoxLayout;
82 QHBoxLayout *nameL =
new QHBoxLayout;
83 QLabel *l =
new QLabel(tr(
"Element name:"));
84 name_ =
new QLineEdit;
85 name_->setText (_name);
87 nameL->addWidget (name_);
88 nameL->setStretchFactor(name_, 1);
90 vL->addLayout (nameL);
103 if (_inputs.size () > 1)
104 configL->addWidget (v->group_);
106 vL->addWidget (v->group_);
111 configL->addStretch(1);
113 QPushButton *ok =
new QPushButton (
"OK");
114 QPushButton *cancel =
new QPushButton (
"Cancel");
116 connect (ok, SIGNAL (pressed ()),
this, SLOT (ok ()));
117 connect (cancel, SIGNAL (pressed ()),
this, SLOT (reject ()));
119 QHBoxLayout *buttonL =
new QHBoxLayout;
120 buttonL->addStretch();
121 buttonL->addWidget (ok);
122 buttonL->addWidget (cancel);
124 if (_inputs.size () > 1)
126 QWidget *sW =
new QWidget;
127 sW->setLayout (configL);
128 QScrollArea *sA =
new QScrollArea;
130 sA->setWidgetResizable (
true);
137 vL->addLayout (buttonL);
159 return name_->text ();
168 void VSI::ConfigDialog::ok ()
172 if (!v->constant_ || v->constant_->isChecked ())
173 v->input_->
set (
true);
175 v->input_->
set (
false);
177 if (v->forceAskUser_ && v->forceAskUser_->isChecked ())
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
QString name()
return entered name
virtual QString toValue()=0
Return the type configuration result to a string.
void set(bool _set)
"Set" flag to mark input as set by user
~ConfigDialog()
Destructor.