00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00024
00025 #include "qvparamwidget.h"
00026
00027 #include <QLineEdit>
00028 #include <QSlider>
00029 #include <QLabel>
00030 #include <QCheckBox>
00031
00032 #include <QVBoxLayout>
00033 #include <QHBoxLayout>
00034
00035 #include <qwt_slider.h>
00036 QVSIntParamWidget::QVSIntParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
00037 {
00038 value = orig_holder->getPropertyValue<int>(property);
00039 info = orig_holder->getPropertyInfo(property);
00040 if(orig_holder->hasRange(property))
00041 {
00042 max = orig_holder->getPropertyMaximum<int>(property);
00043 min = orig_holder->getPropertyMinimum<int>(property);
00044 gui_holder->addProperty<int>(property,QVPropertyContainer::outputFlag,value,"",min,max);
00045 gui_holder->linkProperty(property,orig_holder,property,QVPropertyContainer::AsynchronousLink);
00046
00047 lineedit = new QLineEdit(this);
00048 lineedit->setFixedWidth(80);
00049 slider = new QSlider(Qt::Horizontal,this);
00050 slider->setMinimum(min);
00051 slider->setMaximum(max);
00052 slider->setFixedWidth(150);
00053
00054 QVBoxLayout *vboxlayout = new QVBoxLayout(this);
00055 vboxlayout->setSpacing(0);
00056 QHBoxLayout *hboxlayout1 = new QHBoxLayout();
00057 QLabel *label = new QLabel(QString("<i>int</i> <b>%1</b>").arg(property));
00058 label->setToolTip(info);
00059 hboxlayout1->addWidget(label);
00060 hboxlayout1->addStretch();
00061 hboxlayout1->addWidget(new QLabel(QString("(%1,%2)").arg(min).arg(max)));
00062 QHBoxLayout *hboxlayout2 = new QHBoxLayout();
00063 hboxlayout2->addWidget(lineedit);
00064 hboxlayout2->addStretch();
00065 hboxlayout2->addWidget(slider);
00066 vboxlayout->addLayout(hboxlayout1);
00067 vboxlayout->addLayout(hboxlayout2);
00068
00069 slider->setValue(value);
00070 connect(slider,SIGNAL(valueChanged(int)),this,SLOT(setValue()));
00071 }
00072 else
00073 {
00074 gui_holder->addProperty<int>(property,QVPropertyContainer::outputFlag,value,"");
00075 gui_holder->linkProperty(property,orig_holder,property,QVPropertyContainer::AsynchronousLink);
00076
00077 lineedit = new QLineEdit(this);
00078 lineedit->setFixedWidth(80);
00079
00080 QHBoxLayout *hboxlayout = new QHBoxLayout(this);
00081 QLabel *label = new QLabel(QString("<i>int</i> <b>%1</b>").arg(property));
00082 label->setToolTip(info);
00083 hboxlayout->addWidget(label);
00084 hboxlayout->addStretch();
00085 hboxlayout->addWidget(lineedit);
00086
00087 }
00088
00089 connect(lineedit,SIGNAL(editingFinished()),this,SLOT(setValue()));
00090 gui_holder->setPropertyValue<int>(property,value);
00091 lineedit->setText(QString("%1").arg(value));
00092 emit valueChanged(value);
00093 }
00094
00095 void QVSIntParamWidget::setValue()
00096 {
00097 if(sender() == lineedit)
00098 {
00099 bool ok;
00100 value = lineedit->text().toInt(&ok);
00101 if( (not ok) or
00102 (orig_holder->hasRange(property) and (value<min or value>max) ) )
00103 value = gui_holder->getPropertyValue<int>(property);
00104 }
00105 else if(sender() == slider) {
00106 value = slider->value();
00107 }
00108 else
00109 value = gui_holder->getPropertyValue<int>(property);
00110
00111 lineedit->setText(QString("%1").arg(value));
00112 if(orig_holder->hasRange(property))
00113 slider->setValue(value);
00114 gui_holder->setPropertyValue<int>(property,value);
00115 emit valueChanged(value);
00116 }
00117
00119 QVUIntParamWidget::QVUIntParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
00120 {
00121 value = orig_holder->getPropertyValue<unsigned int>(property);
00122 info = orig_holder->getPropertyInfo(property);
00123 if(orig_holder->hasRange(property))
00124 {
00125 max = orig_holder->getPropertyMaximum<unsigned int>(property);
00126 min = orig_holder->getPropertyMinimum<unsigned int>(property);
00127 gui_holder->addProperty<unsigned int>(property,QVPropertyContainer::outputFlag,value,"",min,max);
00128 gui_holder->linkProperty(property, orig_holder, property, QVPropertyContainer::AsynchronousLink);
00129
00130 lineedit = new QLineEdit(this);
00131 lineedit->setFixedWidth(80);
00132 slider = new QSlider(Qt::Horizontal,this);
00133 slider->setMinimum(min);
00134 slider->setMaximum(max);
00135 slider->setFixedWidth(150);
00136
00137 QVBoxLayout *vboxlayout = new QVBoxLayout(this);
00138 vboxlayout->setSpacing(0);
00139 QHBoxLayout *hboxlayout1 = new QHBoxLayout();
00140 QLabel *label = new QLabel(QString("<i>unsigned int</i> <b>%1</b>").arg(property));
00141 label->setToolTip(info);
00142 hboxlayout1->addWidget(label);
00143 hboxlayout1->addStretch();
00144 hboxlayout1->addWidget(new QLabel(QString("(%1,%2)").arg(min).arg(max)));
00145 QHBoxLayout *hboxlayout2 = new QHBoxLayout();
00146 hboxlayout2->addWidget(lineedit);
00147 hboxlayout2->addStretch();
00148 hboxlayout2->addWidget(slider);
00149 vboxlayout->addLayout(hboxlayout1);
00150 vboxlayout->addLayout(hboxlayout2);
00151
00152 slider->setValue(value);
00153 connect(slider,SIGNAL(valueChanged(unsigned int)),this,SLOT(setValue()));
00154 }
00155 else
00156 {
00157 gui_holder->addProperty<unsigned int>(property,QVPropertyContainer::outputFlag,value,"");
00158 gui_holder->linkProperty(property,orig_holder,property,QVPropertyContainer::AsynchronousLink);
00159
00160 lineedit = new QLineEdit(this);
00161 lineedit->setFixedWidth(80);
00162
00163 QHBoxLayout *hboxlayout = new QHBoxLayout(this);
00164 QLabel *label = new QLabel(QString("<i>unsigned int</i> <b>%1</b>").arg(property));
00165 label->setToolTip(info);
00166 hboxlayout->addWidget(label);
00167 hboxlayout->addStretch();
00168 hboxlayout->addWidget(lineedit);
00169
00170 }
00171
00172 connect(lineedit,SIGNAL(editingFinished()),this,SLOT(setValue()));
00173 gui_holder->setPropertyValue<unsigned int>(property,value);
00174 lineedit->setText(QString("%1").arg(value));
00175 emit valueChanged(value);
00176 }
00177
00178 void QVUIntParamWidget::setValue()
00179 {
00180 if(sender() == lineedit)
00181 {
00182 bool ok;
00183 value = lineedit->text().toInt(&ok);
00184 if( (not ok) or
00185 (orig_holder->hasRange(property) and (value<min or value>max) ) )
00186 value = gui_holder->getPropertyValue<unsigned int>(property);
00187 }
00188 else if(sender() == slider) {
00189 value = slider->value();
00190 }
00191 else
00192 value = gui_holder->getPropertyValue<unsigned int>(property);
00193
00194 lineedit->setText(QString("%1").arg(value));
00195 if(orig_holder->hasRange(property))
00196 slider->setValue(value);
00197 gui_holder->setPropertyValue<unsigned int>(property,value);
00198 emit valueChanged(value);
00199 }
00200
00202
00203 QVSCharParamWidget::QVSCharParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
00204 {
00205 value = orig_holder->getPropertyValue<char>(property);
00206 info = orig_holder->getPropertyInfo(property);
00207 if(orig_holder->hasRange(property))
00208 {
00209 max = orig_holder->getPropertyMaximum<char>(property);
00210 min = orig_holder->getPropertyMinimum<char>(property);
00211 }
00212 else {
00213 max = 255;
00214 min = 0;
00215 }
00216
00217 max = (max > 255)? 255: max;
00218 min = (min < 0)? 0: min;
00219
00220 gui_holder->addProperty<char>(property,QVPropertyContainer::outputFlag,value,"",min,max);
00221 gui_holder->linkProperty(property,orig_holder,property,QVPropertyContainer::AsynchronousLink);
00222
00223 lineedit = new QLineEdit(this);
00224 lineedit->setFixedWidth(80);
00225
00226 slider = new QSlider(Qt::Horizontal,this);
00227 slider->setMinimum(min);
00228 slider->setMaximum(max);
00229 slider->setFixedWidth(150);
00230
00231 QVBoxLayout *vboxlayout = new QVBoxLayout(this);
00232 vboxlayout->setSpacing(0);
00233 QHBoxLayout *hboxlayout1 = new QHBoxLayout();
00234 QLabel *label = new QLabel(QString("<i>char</i> <b>%1</b>").arg(property));
00235 label->setToolTip(info);
00236 hboxlayout1->addWidget(label);
00237 hboxlayout1->addStretch();
00238 hboxlayout1->addWidget(new QLabel(QString("(%1,%2)").arg(min).arg(max)));
00239 QHBoxLayout *hboxlayout2 = new QHBoxLayout();
00240 hboxlayout2->addWidget(lineedit);
00241 hboxlayout2->addStretch();
00242 hboxlayout2->addWidget(slider);
00243 vboxlayout->addLayout(hboxlayout1);
00244 vboxlayout->addLayout(hboxlayout2);
00245
00246 slider->setValue(value);
00247 connect(slider,SIGNAL(valueChanged(int)),this,SLOT(setValue()));
00248
00249 connect(lineedit,SIGNAL(editingFinished()),this,SLOT(setValue()));
00250 gui_holder->setPropertyValue<char>(property,value);
00251 lineedit->setText(QString("%1").arg(value));
00252 emit valueChanged(value);
00253 }
00254
00255 void QVSCharParamWidget::setValue()
00256 {
00257 if(sender() == lineedit)
00258 {
00259 bool ok;
00260 value = lineedit->text().toInt(&ok);
00261 if( (not ok) or
00262 ( (value<min or value>max) ) )
00263 value = gui_holder->getPropertyValue<unsigned char>(property);
00264 }
00265 else if(sender() == slider) {
00266 value = slider->value();
00267 }
00268 else
00269 value = gui_holder->getPropertyValue<unsigned char>(property);
00270
00271 lineedit->setText(QString("%1").arg(value));
00272
00273 slider->setValue(value);
00274 gui_holder->setPropertyValue<unsigned char>(property,value);
00275 emit valueChanged(value);
00276 }
00278
00279 QVUCharParamWidget::QVUCharParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
00280 {
00281 value = orig_holder->getPropertyValue<unsigned char>(property);
00282 info = orig_holder->getPropertyInfo(property);
00283 if(orig_holder->hasRange(property))
00284 {
00285 max = orig_holder->getPropertyMaximum<unsigned char>(property);
00286 min = orig_holder->getPropertyMinimum<unsigned char>(property);
00287 }
00288 else {
00289 max = 255;
00290 min = 0;
00291 }
00292
00293 max = (max > 255)? 255: max;
00294 min = (min < 0)? 0: min;
00295
00296 gui_holder->addProperty<unsigned char>(property,QVPropertyContainer::outputFlag,value,"",min,max);
00297 gui_holder->linkProperty(property,orig_holder,property,QVPropertyContainer::AsynchronousLink);
00298
00299 lineedit = new QLineEdit(this);
00300 lineedit->setFixedWidth(80);
00301
00302 slider = new QSlider(Qt::Horizontal,this);
00303 slider->setMinimum(min);
00304 slider->setMaximum(max);
00305 slider->setFixedWidth(150);
00306
00307 QVBoxLayout *vboxlayout = new QVBoxLayout(this);
00308 vboxlayout->setSpacing(0);
00309 QHBoxLayout *hboxlayout1 = new QHBoxLayout();
00310 QLabel *label = new QLabel(QString("<i>unsigned char</i> <b>%1</b>").arg(property));
00311 label->setToolTip(info);
00312 hboxlayout1->addWidget(label);
00313 hboxlayout1->addStretch();
00314 hboxlayout1->addWidget(new QLabel(QString("(%1,%2)").arg(min).arg(max)));
00315 QHBoxLayout *hboxlayout2 = new QHBoxLayout();
00316 hboxlayout2->addWidget(lineedit);
00317 hboxlayout2->addStretch();
00318 hboxlayout2->addWidget(slider);
00319 vboxlayout->addLayout(hboxlayout1);
00320 vboxlayout->addLayout(hboxlayout2);
00321
00322 slider->setValue(value);
00323 connect(slider,SIGNAL(valueChanged(int)),this,SLOT(setValue()));
00324
00325 connect(lineedit,SIGNAL(editingFinished()),this,SLOT(setValue()));
00326 gui_holder->setPropertyValue<unsigned char>(property,value);
00327 lineedit->setText(QString("%1").arg(value));
00328 emit valueChanged(value);
00329 }
00330
00331 void QVUCharParamWidget::setValue()
00332 {
00333 if(sender() == lineedit)
00334 {
00335 bool ok;
00336 value = lineedit->text().toInt(&ok);
00337 if( (not ok) or
00338 ( (value<min or value>max) ) )
00339 value = gui_holder->getPropertyValue<unsigned char>(property);
00340 }
00341 else if(sender() == slider) {
00342 value = slider->value();
00343 }
00344 else
00345 value = gui_holder->getPropertyValue<unsigned char>(property);
00346
00347 lineedit->setText(QString("%1").arg(value));
00348
00349 slider->setValue(value);
00350 gui_holder->setPropertyValue<unsigned char>(property,value);
00351 emit valueChanged(value);
00352 }
00353
00355 QVDoubleParamWidget::QVDoubleParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
00356 {
00357
00358 value = orig_holder->getPropertyValue<double>(property);
00359 info = orig_holder->getPropertyInfo(property);
00360 if(orig_holder->hasRange(property))
00361 {
00362 max = orig_holder->getPropertyMaximum<double>(property);
00363 min = orig_holder->getPropertyMinimum<double>(property);
00364 gui_holder->addProperty<double>(property,QVPropertyContainer::outputFlag,value,"",min,max);
00365 gui_holder->linkProperty(property,orig_holder,property,QVPropertyContainer::AsynchronousLink);
00366
00367 lineedit = new QLineEdit(this);
00368 lineedit->setFixedWidth(80);
00369 qwtslider = new QwtSlider(this,Qt::Horizontal,QwtSlider::NoScale,QwtSlider::BgSlot);
00370 qwtslider->setThumbLength(20);
00371 qwtslider->setThumbWidth(10);
00372 qwtslider->setRange(min,max);
00373 qwtslider->setFixedWidth(150);
00374
00375 QVBoxLayout *vboxlayout = new QVBoxLayout(this);
00376 vboxlayout->setSpacing(0);
00377 QHBoxLayout *hboxlayout1 = new QHBoxLayout();
00378 QLabel *label = new QLabel(QString("<i>double</i> <b>%1</b>").arg(property));
00379 label->setToolTip(info);
00380 hboxlayout1->addWidget(label);
00381 hboxlayout1->addStretch();
00382 hboxlayout1->addWidget(new QLabel(QString("(%1,%2)").arg(min).arg(max)));
00383 QHBoxLayout *hboxlayout2 = new QHBoxLayout();
00384 hboxlayout2->addWidget(lineedit);
00385 hboxlayout2->addStretch();
00386 hboxlayout2->addWidget(qwtslider);
00387 vboxlayout->addLayout(hboxlayout1);
00388 vboxlayout->addLayout(hboxlayout2);
00389
00390 qwtslider->setValue(value);
00391 connect(qwtslider,SIGNAL(valueChanged(double)),this,SLOT(setValue()));
00392 }
00393 else
00394 {
00395 gui_holder->addProperty<double>(property,QVPropertyContainer::outputFlag,value,"");
00396 gui_holder->linkProperty(property,orig_holder,property,QVPropertyContainer::AsynchronousLink);
00397
00398 lineedit = new QLineEdit(this);
00399 lineedit->setFixedWidth(80);
00400
00401 QHBoxLayout *hboxlayout = new QHBoxLayout(this);
00402 QLabel *label = new QLabel(QString("<i>double</i> <b>%1</b>").arg(property));
00403 label->setToolTip(info);
00404 hboxlayout->addWidget(label);
00405 hboxlayout->addStretch();
00406 hboxlayout->addWidget(lineedit);
00407
00408 }
00409
00410 connect(lineedit,SIGNAL(editingFinished()),this,SLOT(setValue()));
00411 gui_holder->setPropertyValue<double>(property,value);
00412 lineedit->setText(QString("%1").arg(value));
00413 emit valueChanged(value);
00414
00415 }
00416
00417 void QVDoubleParamWidget::setValue()
00418 {
00419 if(sender() == lineedit)
00420 {
00421 bool ok;
00422 value = lineedit->text().toDouble(&ok);
00423 if( (not ok) or
00424 (orig_holder->hasRange(property) and (value<min or value>max) ) )
00425 value = gui_holder->getPropertyValue<double>(property);
00426 }
00427 else if(sender() == qwtslider) {
00428 value = qwtslider->value();
00429 }
00430 else
00431 value = gui_holder->getPropertyValue<double>(property);
00432
00433 lineedit->setText(QString("%1").arg(value));
00434 if(orig_holder->hasRange(property))
00435 qwtslider->setValue(value);
00436 gui_holder->setPropertyValue<double>(property,value);
00437 emit valueChanged(value);
00438 }
00439
00441 QVFloatParamWidget::QVFloatParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
00442 {
00443
00444 value = orig_holder->getPropertyValue<float>(property);
00445 info = orig_holder->getPropertyInfo(property);
00446 if(orig_holder->hasRange(property))
00447 {
00448 max = orig_holder->getPropertyMaximum<float>(property);
00449 min = orig_holder->getPropertyMinimum<float>(property);
00450 gui_holder->addProperty<float>(property,QVPropertyContainer::outputFlag,value,"",min,max);
00451 gui_holder->linkProperty(property,orig_holder,property,QVPropertyContainer::AsynchronousLink);
00452
00453 lineedit = new QLineEdit(this);
00454 lineedit->setFixedWidth(80);
00455 qwtslider = new QwtSlider(this,Qt::Horizontal,QwtSlider::NoScale,QwtSlider::BgSlot);
00456 qwtslider->setThumbLength(20);
00457 qwtslider->setThumbWidth(10);
00458 qwtslider->setRange(min,max);
00459 qwtslider->setFixedWidth(150);
00460
00461 QVBoxLayout *vboxlayout = new QVBoxLayout(this);
00462 vboxlayout->setSpacing(0);
00463 QHBoxLayout *hboxlayout1 = new QHBoxLayout();
00464 QLabel *label = new QLabel(QString("<i>float</i> <b>%1</b>").arg(property));
00465 label->setToolTip(info);
00466 hboxlayout1->addWidget(label);
00467 hboxlayout1->addStretch();
00468 hboxlayout1->addWidget(new QLabel(QString("(%1,%2)").arg(min).arg(max)));
00469 QHBoxLayout *hboxlayout2 = new QHBoxLayout();
00470 hboxlayout2->addWidget(lineedit);
00471 hboxlayout2->addStretch();
00472 hboxlayout2->addWidget(qwtslider);
00473 vboxlayout->addLayout(hboxlayout1);
00474 vboxlayout->addLayout(hboxlayout2);
00475
00476 qwtslider->setValue(value);
00477 connect(qwtslider,SIGNAL(valueChanged(double)),this,SLOT(setValue()));
00478 }
00479 else
00480 {
00481 gui_holder->addProperty<float>(property,QVPropertyContainer::outputFlag,value,"");
00482 gui_holder->linkProperty(property,orig_holder,property,QVPropertyContainer::AsynchronousLink);
00483
00484 lineedit = new QLineEdit(this);
00485 lineedit->setFixedWidth(80);
00486
00487 QHBoxLayout *hboxlayout = new QHBoxLayout(this);
00488 QLabel *label = new QLabel(QString("<i>float</i> <b>%1</b>").arg(property));
00489 label->setToolTip(info);
00490 hboxlayout->addWidget(label);
00491 hboxlayout->addStretch();
00492 hboxlayout->addWidget(lineedit);
00493
00494 }
00495
00496 connect(lineedit,SIGNAL(editingFinished()),this,SLOT(setValue()));
00497 gui_holder->setPropertyValue<float>(property,value);
00498 lineedit->setText(QString("%1").arg(value));
00499 emit valueChanged(value);
00500
00501 }
00502
00503 void QVFloatParamWidget::setValue()
00504 {
00505 if(sender() == lineedit)
00506 {
00507 bool ok;
00508 value = lineedit->text().toFloat(&ok);
00509 if( (not ok) or
00510 (orig_holder->hasRange(property) and (value<min or value>max) ) )
00511 value = gui_holder->getPropertyValue<float>(property);
00512 }
00513 else if(sender() == qwtslider) {
00514 value = qwtslider->value();
00515 }
00516 else
00517 value = gui_holder->getPropertyValue<float>(property);
00518
00519 lineedit->setText(QString("%1").arg(value));
00520 if(orig_holder->hasRange(property))
00521 qwtslider->setValue(value);
00522 gui_holder->setPropertyValue<float>(property,value);
00523 emit valueChanged(value);
00524 }
00525
00527 QVBoolParamWidget::QVBoolParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
00528 {
00529 value = orig_holder->getPropertyValue<bool>(property);
00530 info = orig_holder->getPropertyInfo(property);
00531
00532 QHBoxLayout *hboxlayout = new QHBoxLayout(this);
00533
00534 QLabel *label = new QLabel(QString("<i>bool</i> <b>%1</b>").arg(property),this);
00535 label->setToolTip(info);
00536 hboxlayout->addWidget(label);
00537 hboxlayout->addStretch();
00538 checkbox = new QCheckBox(this);
00539 hboxlayout->addWidget(checkbox);
00540
00541 gui_holder->addProperty<bool>(property,QVPropertyContainer::outputFlag,value,"");
00542
00543 gui_holder->linkProperty(property,orig_holder,property,QVPropertyContainer::AsynchronousLink);
00544
00545 connect(checkbox,SIGNAL(stateChanged(int)),this,SLOT(setValue()));
00546 gui_holder->setPropertyValue<bool>(property,value);
00547 if(value)
00548 checkbox->setCheckState(Qt::Checked);
00549 else
00550 checkbox->setCheckState(Qt::Unchecked);
00551 emit valueChanged(value);
00552 }
00553
00554 void QVBoolParamWidget::setValue()
00555 {
00556 if (checkbox->checkState() == Qt::Unchecked)
00557 value = false;
00558 else if (checkbox->checkState() == Qt::Checked)
00559 value = true;
00560
00561 gui_holder->setPropertyValue<bool>(property,value);
00562 emit valueChanged(value);
00563 }
00564
00566 QVStringParamWidget::QVStringParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
00567 {
00568 value = orig_holder->getPropertyValue<QString>(property);
00569 info = orig_holder->getPropertyInfo(property);
00570
00571 QHBoxLayout *hboxlayout = new QHBoxLayout(this);
00572 hboxlayout->setSpacing(0);
00573 QLabel *label = new QLabel(QString("<i>string</i> <b>%1 </b>").arg(property),this);
00574 label->setToolTip(info);
00575 hboxlayout->addWidget(label);
00576 lineedit = new QLineEdit(this);
00577 hboxlayout->addWidget(lineedit);
00578
00579 lineedit->setText(value);
00580
00581 gui_holder->addProperty<QString>(property,QVPropertyContainer::outputFlag,value,"");
00582 gui_holder->linkProperty(property,orig_holder,property,QVPropertyContainer::AsynchronousLink);
00583
00584 connect(lineedit,SIGNAL(textChanged(QString)),this,SLOT(setValue()));
00585
00586 gui_holder->setPropertyValue<QString>(property,value);
00587
00588 emit valueChanged(value);
00589 }
00590
00591 void QVStringParamWidget::setValue()
00592 {
00593 value = lineedit->text();
00594 gui_holder->setPropertyValue<QString>(property,value);
00595 emit valueChanged(value);
00596 }
00597
00599 QVStringListParamWidget::QVStringListParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
00600 {
00601 value = orig_holder->getPropertyValue<QVIndexedStringList>(property);
00602 info = orig_holder->getPropertyInfo(property);
00603
00604 QHBoxLayout *hboxlayout = new QHBoxLayout(this);
00605 hboxlayout->setSpacing(0);
00606 QLabel *label = new QLabel(QString("<i>stringlist</i> <b>%1</b>").arg(property),this);
00607 label->setToolTip(info);
00608 hboxlayout->addWidget(label);
00609 combobox = new QComboBox(this);
00610 hboxlayout->addWidget(combobox);
00611
00612 gui_holder->addProperty<QVIndexedStringList>(property,QVPropertyContainer::outputFlag,value,"");
00613 gui_holder->linkProperty(property,orig_holder,property,QVPropertyContainer::AsynchronousLink);
00614
00615 connect(combobox,SIGNAL(activated(int)),this,SLOT(setValue()));
00616
00617 gui_holder->setPropertyValue<QVIndexedStringList>(property,value);
00618
00619 combobox->addItems(value);
00620 combobox->setCurrentIndex(value.getIndex());
00621 emit valueChanged(value);
00622 }
00623
00624 void QVStringListParamWidget::setValue()
00625 {
00626 value.setIndex(combobox->currentIndex());
00627 gui_holder->setPropertyValue<QVIndexedStringList>(property,value);
00628 emit valueChanged(value);
00629 }
00630
00632 QVProcessingBlockTriggerWidget::QVProcessingBlockTriggerWidget(QVProcessingBlock *block, const QString triggername, QWidget *parent): QWidget(parent), block(block), triggername(triggername)
00633 {
00634 QHBoxLayout *hboxlayout = new QHBoxLayout(this);
00635 toolbutton = new QToolButton(this);
00636 toolbutton->setText(triggername);
00637 hboxlayout->addWidget(new QLabel(QString("<i>trigger</i> <b>%1</b>").arg(triggername)));
00638 hboxlayout->addStretch();
00639 hboxlayout->addWidget(toolbutton);
00640
00641 connect(toolbutton,SIGNAL(pressed()),this,SLOT(setValue()));
00642 connect(this,SIGNAL(valueChanged(QString)),block,SLOT(processTrigger(QString)),Qt::QueuedConnection);
00643 }
00644
00645 void QVProcessingBlockTriggerWidget::setValue()
00646 {
00647 emit valueChanged(triggername);
00648 }
00649
00650
00651
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00663
00664 QVColorParamWidget::QVColorParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
00665 {
00666 const int max = 255, min = 0;
00667 value = orig_holder->getPropertyValue<QColor>(property);
00668 info = orig_holder->getPropertyInfo(property);
00669
00670 gui_holder->addProperty<QColor>(property,QVPropertyContainer::outputFlag,value,"");
00671 gui_holder->linkProperty(property,orig_holder,property,QVPropertyContainer::AsynchronousLink);
00672
00673 lineeditR = new QLineEdit(this);
00674 lineeditR->setFixedWidth(80);
00675 lineeditG = new QLineEdit(this);
00676 lineeditG->setFixedWidth(80);
00677 lineeditB = new QLineEdit(this);
00678 lineeditB->setFixedWidth(80);
00679
00680 sliderR = new QSlider(Qt::Horizontal,this);
00681 sliderR->setMinimum(min);
00682 sliderR->setMaximum(max);
00683 sliderR->setFixedWidth(150);
00684
00685 sliderG = new QSlider(Qt::Horizontal,this);
00686 sliderG->setMinimum(min);
00687 sliderG->setMaximum(max);
00688 sliderG->setFixedWidth(150);
00689
00690 sliderB = new QSlider(Qt::Horizontal,this);
00691 sliderB->setMinimum(min);
00692 sliderB->setMaximum(max);
00693 sliderB->setFixedWidth(150);
00694
00695 QHBoxLayout *hboxlayout1 = new QHBoxLayout();
00696 QLabel *label = new QLabel(QString("<i>int</i> <b>%1</b>").arg(property));
00697 label->setToolTip(info);
00698 hboxlayout1->addWidget(label);
00699 hboxlayout1->addStretch();
00700 hboxlayout1->addWidget(new QLabel(QString("(%1,%2)").arg(min).arg(max)));
00701
00702 QHBoxLayout *hboxlayoutR = new QHBoxLayout();
00703 hboxlayoutR->addWidget(new QLabel(QString("R")));
00704 hboxlayoutR->addWidget(lineeditR);
00705 hboxlayoutR->addStretch();
00706 hboxlayoutR->addWidget(sliderR);
00707
00708 QHBoxLayout *hboxlayoutG = new QHBoxLayout();
00709 hboxlayoutG->addWidget(new QLabel(QString("G")));
00710 hboxlayoutG->addWidget(lineeditG);
00711 hboxlayoutG->addStretch();
00712 hboxlayoutG->addWidget(sliderG);
00713
00714 QHBoxLayout *hboxlayoutB = new QHBoxLayout();
00715 hboxlayoutB->addWidget(new QLabel(QString("B")));
00716 hboxlayoutB->addWidget(lineeditB);
00717 hboxlayoutB->addStretch();
00718 hboxlayoutB->addWidget(sliderB);
00719
00720 QVBoxLayout *vboxlayout = new QVBoxLayout(this);
00721 vboxlayout->setSpacing(0);
00722 vboxlayout->addLayout(hboxlayout1);
00723 vboxlayout->addLayout(hboxlayoutR);
00724 vboxlayout->addLayout(hboxlayoutG);
00725 vboxlayout->addLayout(hboxlayoutB);
00726
00727 sliderR->setValue(value.red());
00728 sliderG->setValue(value.green());
00729 sliderB->setValue(value.blue());
00730 connect(sliderR,SIGNAL(valueChanged(int)),this,SLOT(setValue()));
00731 connect(sliderG,SIGNAL(valueChanged(int)),this,SLOT(setValue()));
00732 connect(sliderB,SIGNAL(valueChanged(int)),this,SLOT(setValue()));
00733
00734 connect(lineeditR,SIGNAL(editingFinished()),this,SLOT(setValue()));
00735 connect(lineeditG,SIGNAL(editingFinished()),this,SLOT(setValue()));
00736 connect(lineeditB,SIGNAL(editingFinished()),this,SLOT(setValue()));
00737 gui_holder->setPropertyValue<QColor>(property,value);
00738 lineeditR->setText(QString("%1").arg(value.red()));
00739 lineeditG->setText(QString("%1").arg(value.green()));
00740 lineeditB->setText(QString("%1").arg(value.blue()));
00741 emit valueChanged(value);
00742 }
00743
00744 void QVColorParamWidget::setValue()
00745 {
00746 if(sender() == lineeditR || sender() == lineeditG || sender() == lineeditB)
00747 value = QColor( lineeditR->text().toInt(), lineeditG->text().toInt(), lineeditB->text().toInt() );
00748 else if(sender() == sliderR || sender() == sliderG || sender() == sliderB)
00749 value = QColor( sliderR->value(), sliderG->value(), sliderB->value() );
00750 else
00751 value = gui_holder->getPropertyValue<QColor>(property);
00752
00753 lineeditR->setText(QString("%1").arg(value.red()));
00754 lineeditG->setText(QString("%1").arg(value.green()));
00755 lineeditB->setText(QString("%1").arg(value.blue()));
00756
00757 sliderR->setValue(value.red());
00758 sliderG->setValue(value.green());
00759 sliderB->setValue(value.blue());
00760
00761 std::cout << "Setting color to " << value.red() << ", " << value.green() << ", " << value.blue()
00762 << std::endl;
00763 gui_holder->setPropertyValue<QColor>(property,value);
00764 emit valueChanged(value);
00765 }
00766
00768 QVSizeParamWidget::QVSizeParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
00769 {
00770 value = orig_holder->getPropertyValue<QSize>(property);
00771
00772 gui_holder->addProperty<QSize>(property,QVPropertyContainer::outputFlag,value);
00773 gui_holder->linkProperty(property,orig_holder,property,QVPropertyContainer::AsynchronousLink);
00774
00775 lineWidth = new QLineEdit(this);
00776 lineWidth->setFixedWidth(80);
00777
00778 lineHeight = new QLineEdit(this);
00779 lineHeight->setFixedWidth(80);
00780
00781 QHBoxLayout *hboxnamelayout = new QHBoxLayout();
00782 hboxnamelayout->addWidget(new QLabel(QString("<i>QSize</i> <b>%1</b>").arg(property)));
00783
00784 QHBoxLayout *hboxwidthlayout = new QHBoxLayout();
00785 hboxwidthlayout->addWidget(lineWidth);
00786 hboxwidthlayout->addStretch();
00787 hboxwidthlayout->addWidget(new QLabel(QString("Width")));
00788
00789 QHBoxLayout *hboxheightlayout = new QHBoxLayout();
00790 hboxheightlayout->addWidget(lineHeight);
00791 hboxheightlayout->addStretch();
00792 hboxheightlayout->addWidget(new QLabel(QString("Height")));
00793
00794 QVBoxLayout *vboxlayout = new QVBoxLayout(this);
00795 vboxlayout->setSpacing(0);
00796 vboxlayout->addLayout(hboxnamelayout);
00797 vboxlayout->addLayout(hboxwidthlayout);
00798 vboxlayout->addLayout(hboxheightlayout);
00799
00800 connect(lineWidth,SIGNAL(editingFinished()),this,SLOT(setValue()));
00801 gui_holder->setPropertyValue<QSize>(property,value);
00802 lineWidth->setText(QString("%1").arg(value.width()));
00803 lineHeight->setText(QString("%1").arg(value.height()));
00804 emit valueChanged(value);
00805 }
00806
00807 void QVSizeParamWidget::setValue()
00808 {
00809 if(sender() == lineWidth ||sender() == lineHeight)
00810 {
00811 bool ok1, ok2;
00812 value = QSize(lineWidth->text().toInt(&ok1), lineHeight->text().toInt(&ok2));
00813 if(not ok1 || not ok2)
00814 value = gui_holder->getPropertyValue<QSize>(property);
00815 }
00816 else
00817 value = gui_holder->getPropertyValue<QSize>(property);
00818
00819 lineWidth->setText(QString("%1").arg(value.width()));
00820 lineHeight->setText(QString("%1").arg(value.height()));
00821 gui_holder->setPropertyValue<QSize>(property,value);
00822 emit valueChanged(value);
00823 }
00824
00826
00827 QVPointParamWidget::QVPointParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
00828 {
00829 value = orig_holder->getPropertyValue<QPoint>(property);
00830
00831 gui_holder->addProperty<QPoint>(property,QVPropertyContainer::outputFlag,value);
00832 gui_holder->linkProperty(property,orig_holder,property,QVPropertyContainer::AsynchronousLink);
00833
00834 lineX = new QLineEdit(this);
00835 lineX->setFixedWidth(80);
00836
00837 lineY = new QLineEdit(this);
00838 lineY->setFixedWidth(80);
00839
00840 QHBoxLayout *hboxnamelayout = new QHBoxLayout();
00841 hboxnamelayout->addWidget(new QLabel(QString("<i>QPoint</i> <b>%1</b>").arg(property)));
00842
00843 QHBoxLayout *hboxwidthlayout = new QHBoxLayout();
00844 hboxwidthlayout->addWidget(lineX);
00845 hboxwidthlayout->addStretch();
00846 hboxwidthlayout->addWidget(new QLabel(QString("x")));
00847
00848 QHBoxLayout *hboxheightlayout = new QHBoxLayout();
00849 hboxheightlayout->addWidget(lineY);
00850 hboxheightlayout->addStretch();
00851 hboxheightlayout->addWidget(new QLabel(QString("y")));
00852
00853 QVBoxLayout *vboxlayout = new QVBoxLayout(this);
00854 vboxlayout->setSpacing(0);
00855 vboxlayout->addLayout(hboxnamelayout);
00856 vboxlayout->addLayout(hboxwidthlayout);
00857 vboxlayout->addLayout(hboxheightlayout);
00858
00859 connect(lineX,SIGNAL(editingFinished()),this,SLOT(setValue()));
00860 gui_holder->setPropertyValue<QPoint>(property,value);
00861 lineX->setText(QString("%1").arg(value.x()));
00862 lineY->setText(QString("%1").arg(value.y()));
00863 emit valueChanged(value);
00864 }
00865
00866 void QVPointParamWidget::setValue()
00867 {
00868 if(sender() == lineX ||sender() == lineY)
00869 {
00870 bool ok1, ok2;
00871 value = QPoint(lineX->text().toInt(&ok1), lineY->text().toInt(&ok2));
00872 if(not ok1 || not ok2)
00873 value = gui_holder->getPropertyValue<QPoint>(property);
00874 }
00875 else
00876 value = gui_holder->getPropertyValue<QPoint>(property);
00877
00878 lineX->setText(QString("%1").arg(value.x()));
00879 lineY->setText(QString("%1").arg(value.y()));
00880 gui_holder->setPropertyValue<QPoint>(property,value);
00881 emit valueChanged(value);
00882 }
00883
00885 #ifdef QVIPP
00886 QVIppiMaskSizeParamWidget::QVIppiMaskSizeParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
00887 {
00888 QHBoxLayout *hboxlayout = new QHBoxLayout(this);
00889 hboxlayout->setSpacing(0);
00890 QLabel *label = new QLabel(QString("<i>IppiMaskSize</i> <b>%1</b>").arg(property),this);
00891 hboxlayout->addWidget(label);
00892 combobox = new QComboBox(this);
00893 hboxlayout->addWidget(combobox);
00894
00895 value = orig_holder->getPropertyValue<IppiMaskSize>(property);
00896
00897 gui_holder->addProperty<IppiMaskSize>(property,QVPropertyContainer::outputFlag,value);
00898 gui_holder->setPropertyValue<IppiMaskSize>(property,value);
00899
00900 gui_holder->linkProperty(property,orig_holder,property,QVPropertyContainer::AsynchronousLink);
00901
00902 connect(combobox,SIGNAL(activated(int)),this,SLOT(setValue()));
00903
00904 QVIndexedStringList ippiMaskSizes;
00905 ippiMaskSizes.append("ippMskSize3x1");
00906 ippiMaskSizes.append("ippMskSize5x1");
00907 ippiMaskSizes.append("ippMskSize1x3");
00908 ippiMaskSizes.append("ippMskSize3x3");
00909 ippiMaskSizes.append("ippMskSize1x5");
00910 ippiMaskSizes.append("ippMskSize5x5");
00911 combobox->addItems(ippiMaskSizes);
00912
00913 combobox->setCurrentIndex(
00914 (value==ippMskSize3x1)? 0:
00915 (value==ippMskSize5x1)? 1:
00916 (value==ippMskSize1x3)? 2:
00917 (value==ippMskSize3x3)? 3:
00918 (value==ippMskSize1x5)? 4:
00919 5);
00920
00921 emit valueChanged(value);
00922 }
00923
00924 void QVIppiMaskSizeParamWidget::setValue()
00925 {
00926 value = (combobox->currentIndex()==0)? ippMskSize3x1:
00927 (combobox->currentIndex()==1)? ippMskSize5x1:
00928 (combobox->currentIndex()==2)? ippMskSize1x3:
00929 (combobox->currentIndex()==3)? ippMskSize3x3:
00930 (combobox->currentIndex()==4)? ippMskSize1x5:
00931 ippMskSize5x5;
00932
00933 gui_holder->setPropertyValue<IppiMaskSize>(property,value);
00934 emit valueChanged(value);
00935 }
00936
00937 QVIppCmpOpParamWidget::QVIppCmpOpParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
00938 {
00939 QHBoxLayout *hboxlayout = new QHBoxLayout(this);
00940 hboxlayout->setSpacing(0);
00941 QLabel *label = new QLabel(QString("<i>IppiCmpOp</i> <b>%1</b>").arg(property),this);
00942 hboxlayout->addWidget(label);
00943 combobox = new QComboBox(this);
00944 hboxlayout->addWidget(combobox);
00945
00946 value = orig_holder->getPropertyValue<IppCmpOp>(property);
00947
00948 gui_holder->addProperty<IppCmpOp>(property,QVPropertyContainer::outputFlag,value);
00949 gui_holder->setPropertyValue<IppCmpOp>(property,value);
00950
00951 gui_holder->linkProperty(property,orig_holder,property,QVPropertyContainer::AsynchronousLink);
00952
00953 connect(combobox,SIGNAL(activated(int)),this,SLOT(setValue()));
00954
00955 QVIndexedStringList ippCmpOp;
00956 ippCmpOp.append("ippCmpLess");
00957 ippCmpOp.append("ippCmpLessEq");
00958 ippCmpOp.append("ippCmpEq");
00959 ippCmpOp.append("ippCmpGreaterEq");
00960 ippCmpOp.append("ippCmpGreater");
00961
00962 combobox->addItems(ippCmpOp);
00963 combobox->setCurrentIndex(
00964 (value==ippCmpLess)? 0:
00965 (value==ippCmpLessEq)? 1:
00966 (value==ippCmpEq)? 2:
00967 (value==ippCmpGreaterEq)? 3:
00968 4);
00969
00970 emit valueChanged(value);
00971 }
00972
00973 void QVIppCmpOpParamWidget::setValue()
00974 {
00975 value = (combobox->currentIndex()==1)? ippCmpLess:
00976 (combobox->currentIndex()==2)? ippCmpLessEq:
00977 (combobox->currentIndex()==3)? ippCmpEq:
00978 (combobox->currentIndex()==4)? ippCmpGreaterEq:
00979 ippCmpGreater;
00980
00981 gui_holder->setPropertyValue<IppCmpOp>(property,value);
00982 emit valueChanged(value);
00983 }
00984
00985
00987
00988 QVIppRoundModeParamWidget::QVIppRoundModeParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
00989 {
00990 QHBoxLayout *hboxlayout = new QHBoxLayout(this);
00991 hboxlayout->setSpacing(0);
00992 QLabel *label = new QLabel(QString("<i>IppRoundMode</i> <b>%1</b>").arg(property),this);
00993 hboxlayout->addWidget(label);
00994 combobox = new QComboBox(this);
00995 hboxlayout->addWidget(combobox);
00996
00997 value = orig_holder->getPropertyValue<IppRoundMode>(property);
00998
00999 gui_holder->addProperty<IppRoundMode>(property,QVPropertyContainer::outputFlag,value);
01000 gui_holder->setPropertyValue<IppRoundMode>(property,value);
01001
01002 gui_holder->linkProperty(property,orig_holder,property,QVPropertyContainer::AsynchronousLink);
01003
01004 connect(combobox,SIGNAL(activated(int)),this,SLOT(setValue()));
01005
01006 QVIndexedStringList ippRoundMode;
01007 ippRoundMode.append("ippRndZero");
01008 ippRoundMode.append("ippRndNear");
01009 ippRoundMode.append("ippRndFinancial");
01010
01011 combobox->addItems(ippRoundMode);
01012 combobox->setCurrentIndex(
01013 (value==ippRndZero)? 0:
01014 (value==ippRndNear)? 1:
01015 2);
01016
01017 emit valueChanged(value);
01018 }
01019
01020 void QVIppRoundModeParamWidget::setValue()
01021 {
01022 value = (combobox->currentIndex()==1)? ippRndZero:
01023 (combobox->currentIndex()==2)? ippRndNear:
01024 ippRndFinancial;
01025
01026 gui_holder->setPropertyValue<IppRoundMode>(property,value);
01027 emit valueChanged(value);
01028 }
01029 #endif
01030
01032
01033
01034
01035 QVOutputIntParamWidget::QVOutputIntParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
01036 {
01037 value = orig_holder->getPropertyValue<int>(property);
01038 info = orig_holder->getPropertyInfo(property);
01039
01040 gui_holder->addProperty<int>(property,QVPropertyContainer::inputFlag,value,"");
01041 _orig_holder->linkProperty(property,_gui_holder,property,QVPropertyContainer::AsynchronousLink);
01042
01043 QHBoxLayout *hboxlayout = new QHBoxLayout(this);
01044 label = new QLabel(QString("<i>int</i> <b>%1: %2</b>").arg(property).arg(value));
01045 label->setToolTip(info);
01046 hboxlayout->addWidget(label);
01047 hboxlayout->addStretch();
01048
01049 gui_holder->setPropertyValue<int>(property,value);
01050 }
01051
01052 void QVOutputIntParamWidget::update()
01053 {
01054 value = gui_holder->getPropertyValue<int>(property);
01055 label->setText(QString("<i>int</i> <b>%1: %2</b>").arg(property).arg(value));
01056 }
01057
01058 QVOutputDoubleParamWidget::QVOutputDoubleParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
01059 {
01060 value = orig_holder->getPropertyValue<double>(property);
01061 info = orig_holder->getPropertyInfo(property);
01062
01063 gui_holder->addProperty<double>(property,QVPropertyContainer::inputFlag,value,"");
01064 _orig_holder->linkProperty(property,_gui_holder,property,QVPropertyContainer::AsynchronousLink);
01065
01066 QHBoxLayout *hboxlayout = new QHBoxLayout(this);
01067 label = new QLabel(QString("<i>double</i> <b>%1: %2</b>").arg(property).arg(value));
01068 label->setToolTip(info);
01069 hboxlayout->addWidget(label);
01070 hboxlayout->addStretch();
01071
01072 gui_holder->setPropertyValue<double>(property,value);
01073 }
01074
01075 void QVOutputDoubleParamWidget::update()
01076 {
01077 value = gui_holder->getPropertyValue<double>(property);
01078 label->setText(QString("<i>double</i> <b>%1: %2</b>").arg(property).arg(value));
01079 }
01080
01081 QVOutputBoolParamWidget::QVOutputBoolParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
01082 {
01083 value = orig_holder->getPropertyValue<bool>(property);
01084 info = orig_holder->getPropertyInfo(property);
01085
01086 gui_holder->addProperty<bool>(property,QVPropertyContainer::inputFlag,value,"");
01087 _orig_holder->linkProperty(property,_gui_holder,property,QVPropertyContainer::AsynchronousLink);
01088
01089 QHBoxLayout *hboxlayout = new QHBoxLayout(this);
01090 if (value) {
01091 label = new QLabel(QString("<i>bool</i> <b>%1: TRUE</b>").arg(property));
01092 label->setToolTip(info);
01093 }
01094 else {
01095 label = new QLabel(QString("<i>bool</i> <b>%1: FALSE</b>").arg(property));
01096 label->setToolTip(info);
01097 }
01098 hboxlayout->addWidget(label);
01099 hboxlayout->addStretch();
01100
01101 gui_holder->setPropertyValue<bool>(property,value);
01102 }
01103
01104 void QVOutputBoolParamWidget::update()
01105 {
01106 value = gui_holder->getPropertyValue<bool>(property);
01107 if (value) {
01108 label = new QLabel(QString("<i>bool</i> <b>%1: TRUE</b>").arg(property));
01109 label->setToolTip(info);
01110 }
01111 else {
01112 label = new QLabel(QString("<i>bool</i> <b>%1: FALSE</b>").arg(property));
01113 label->setToolTip(info);
01114 }
01115 }
01116
01117 QVOutputStringParamWidget::QVOutputStringParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
01118 {
01119 value = orig_holder->getPropertyValue<QString>(property);
01120 info = orig_holder->getPropertyInfo(property);
01121
01122 gui_holder->addProperty<QString>(property,QVPropertyContainer::inputFlag,value,"");
01123 _orig_holder->linkProperty(property,_gui_holder,property,QVPropertyContainer::AsynchronousLink);
01124
01125 QHBoxLayout *hboxlayout = new QHBoxLayout(this);
01126 label = new QLabel(QString("<i>string</i> <b>%1: %2</b>").arg(property).arg(value));
01127 label->setToolTip(info);
01128 hboxlayout->addWidget(label);
01129 hboxlayout->addStretch();
01130
01131 gui_holder->setPropertyValue<QString>(property,value);
01132 }
01133
01134 void QVOutputStringParamWidget::update()
01135 {
01136 value = gui_holder->getPropertyValue<QString>(property);
01137 label->setText(QString("<i>string</i> <b>%1: %2</b>").arg(property).arg(value));
01138 }
01139
01140 QVOutputStringListParamWidget::QVOutputStringListParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
01141 {
01142 value = orig_holder->getPropertyValue<QVIndexedStringList>(property);
01143 info = orig_holder->getPropertyInfo(property);
01144
01145 gui_holder->addProperty<QVIndexedStringList>(property,QVPropertyContainer::inputFlag,value,"");
01146 _orig_holder->linkProperty(property,_gui_holder,property,QVPropertyContainer::AsynchronousLink);
01147
01148 QHBoxLayout *hboxlayout = new QHBoxLayout(this);
01149 label = new QLabel(QString("<i>indexed string list</i> <b>%1: %2</b>").arg(property).arg(value.getCurrent()));
01150 label->setToolTip(info);
01151 hboxlayout->addWidget(label);
01152 hboxlayout->addStretch();
01153
01154 gui_holder->setPropertyValue<QVIndexedStringList>(property,value);
01155 }
01156
01157 void QVOutputStringListParamWidget::update()
01158 {
01159 value = gui_holder->getPropertyValue<QVIndexedStringList>(property);
01160 label->setText(QString("<i>indexed string list</i> <b>%1: %2</b>").arg(property).arg(value.getCurrent()));
01161 }
01162
01163 QVOutputColorParamWidget::QVOutputColorParamWidget(QVPropertyContainer *_orig_holder, QVPropertyContainer *_gui_holder, const QString _property, QWidget *parent): QWidget(parent), orig_holder(_orig_holder), gui_holder(_gui_holder), property(_property)
01164 {
01165 value = orig_holder->getPropertyValue<QColor>(property);
01166 info = orig_holder->getPropertyInfo(property);
01167
01168 gui_holder->addProperty<QColor>(property,QVPropertyContainer::inputFlag,value,"");
01169 _orig_holder->linkProperty(property,_gui_holder,property,QVPropertyContainer::AsynchronousLink);
01170
01171 QHBoxLayout *hboxlayout = new QHBoxLayout(this);
01172 label = new QLabel(QString("<i>color</i> <b>%1: R = %2 G = %3 B = %4</b>").arg(property).arg(value.red()).arg(value.green()).arg(value.blue()));
01173 label->setToolTip(info);
01174 hboxlayout->addWidget(label);
01175 hboxlayout->addStretch();
01176
01177 gui_holder->setPropertyValue<QColor>(property,value);
01178 }
01179
01180 void QVOutputColorParamWidget::update()
01181 {
01182 value = gui_holder->getPropertyValue<QColor>(property);
01183 label->setText(QString("<i>color</i> <b>%1: R = %2 G = %3 B = %4</b>").arg(property).arg(value.red()).arg(value.green()).arg(value.blue()));
01184 }