resolved problem that on updating the type of defaultValue than type of inputwidget does not get updated
This commit is contained in:
parent
9fa610e631
commit
a210ddb2c8
6 changed files with 22 additions and 10 deletions
|
|
@ -104,32 +104,32 @@ void ParameterWidget::connectWidget()
|
|||
for(entry_map_t::iterator it = entries.begin(); it != entries.end(); it++) {
|
||||
ParameterVirtualWidget *entry ;
|
||||
switch (it->second->target) {
|
||||
case 1:{
|
||||
case COMBOBOX:{
|
||||
entry = new ParameterComboBox(it->second);
|
||||
break;
|
||||
}
|
||||
case 2:{
|
||||
case SLIDER:{
|
||||
entry = new ParameterSlider(it->second);
|
||||
break;
|
||||
}
|
||||
case 3:{
|
||||
case CHECKBOX:{
|
||||
entry = new ParameterCheckBox(it->second);
|
||||
break;
|
||||
}
|
||||
case 4:{
|
||||
case TEXT:{
|
||||
entry = new ParameterText(it->second);
|
||||
break;
|
||||
}
|
||||
case 5:{
|
||||
case NUMBER:{
|
||||
entry = new ParameterSpinBox(it->second);
|
||||
break;
|
||||
}
|
||||
case 6:{
|
||||
case VECTOR:{
|
||||
entry = new ParameterVector(it->second);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(it->second->target!=0){
|
||||
if(it->second->target!=UNDEFINED){
|
||||
connect(entry, SIGNAL(changed()), this, SLOT(onValueChanged()));
|
||||
addEntry(entry);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ class ParameterWidget : public QWidget, public Ui::ParameterWidget, public Param
|
|||
{
|
||||
Q_OBJECT
|
||||
|
||||
QTimer autoPreviewTimer;
|
||||
typedef enum { UNDEFINED, COMBOBOX, SLIDER, CHECKBOX, TEXT, NUMBER, VECTOR } parameter_type_t;
|
||||
QTimer autoPreviewTimer;
|
||||
|
||||
public:
|
||||
ParameterWidget(QWidget *parent = 0);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#include "expression.h"
|
||||
#include "context.h"
|
||||
#include "evalcontext.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <boost/assign/std/vector.hpp>
|
||||
using namespace boost::assign; // bring 'operator+=()' into scope
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@ ParameterExtractor::ParameterExtractor()
|
|||
{
|
||||
}
|
||||
|
||||
ParameterExtractor::~ParameterExtractor()
|
||||
{
|
||||
}
|
||||
void ParameterExtractor::applyParameters(FileModule *fileModule)
|
||||
{
|
||||
if (fileModule == NULL) {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ protected:
|
|||
|
||||
public:
|
||||
ParameterExtractor();
|
||||
virtual ~ParameterExtractor();
|
||||
void setParameters(const Module *module);
|
||||
void applyParameters(class FileModule *fileModule);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,19 @@
|
|||
#include "parameterobject.h"
|
||||
|
||||
#include "module.h"
|
||||
#include "modcontext.h"
|
||||
|
||||
ParameterObject::ParameterObject()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ParameterObject::applyParameter(class Assignment *assignment){
|
||||
assignment->second = shared_ptr<Expression>(new ExpressionConst(value));
|
||||
ModuleContext ctx;
|
||||
const ValuePtr defaultValue =assignment->second.get()->evaluate(&ctx);
|
||||
if( defaultValue->type() == dvt ){
|
||||
assignment->second = shared_ptr<Expression>(new ExpressionConst(value));
|
||||
}
|
||||
}
|
||||
|
||||
int ParameterObject::setValue(const class ValuePtr defaultValue, const class ValuePtr values){
|
||||
|
|
|
|||
Loading…
Reference in a new issue