00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00024
00025 #include <qvgui/qvparamsinspectorwidget.h>
00026
00027 #include <QtGui/QWidget>
00028
00029 #include <qvcore/qvpropertycontainer.h>
00030 #include <qvcore/qvworker.h>
00031 #include <qvgui/qvparamwidget.h>
00032
00033
00034 QVParamsInspectorWidget::QVParamsInspectorWidget(QVPropertyContainer *holder, QWidget *parent):QWidget(parent)
00035 {
00036
00037
00038 vboxLayout = new QVBoxLayout(this);
00039 vboxLayout->setSpacing(0);
00040
00041 QVWorker *worker;
00042 if((worker = dynamic_cast<QVWorker*>(holder)) != NULL)
00043 {
00044 QListIterator<QString> iter(worker->getTriggerList());
00045 while (iter.hasNext())
00046 {
00047 QString property(iter.next());
00048 QVWorkerTriggerWidget *triggerwidget =
00049 new QVWorkerTriggerWidget(worker, property, this);
00050 vboxLayout->addWidget(triggerwidget);
00051 }
00052 }
00053
00054 QListIterator<QString> iter(holder->getPropertyList());
00055 while (iter.hasNext())
00056 {
00057 QString property(iter.next());
00058
00059 if(not holder->isLinkedInput(property) and holder->isInput(property))
00060 {
00061 if(holder->isType<int>(property))
00062 {
00063 QVIntParamWidget *int_widget = new QVIntParamWidget(holder,this,property);
00064 vboxLayout->addWidget(int_widget);
00065 writeOutputProperties();
00066 connect(int_widget,SIGNAL(valueChanged(int)),this,SLOT(somePropertyChanged()));
00067 }
00068 else if(holder->isType<double>(property))
00069 {
00070 QVDoubleParamWidget *double_widget = new QVDoubleParamWidget(holder,this,property);
00071 vboxLayout->addWidget(double_widget);
00072 writeOutputProperties();
00073 connect(double_widget,SIGNAL(valueChanged(double)),this,SLOT(somePropertyChanged()));
00074 }
00075 else if(holder->isType<bool>(property))
00076 {
00077 QVBoolParamWidget *bool_widget = new QVBoolParamWidget(holder,this,property);
00078 vboxLayout->addWidget(bool_widget);
00079 writeOutputProperties();
00080 connect(bool_widget,SIGNAL(valueChanged(bool)),this,SLOT(somePropertyChanged()));
00081 }
00082 }
00083 }
00084
00085 vboxLayout->addStretch();
00086
00087 }
00088
00089 void QVParamsInspectorWidget::somePropertyChanged()
00090 {
00091 writeOutputProperties();
00092 }