20#include "propertywidgetproxy.h"
29PropertyWidgetProxy::PropertyWidgetProxy(TQWidget *parent,
const char *name)
30 :TQWidget(parent, name), mp(0), m_propertyType(Property::Invalid), m_editor(0)
33 m_layout =
new TQHBoxLayout(
this, 0, 0);
36PropertyWidgetProxy::~PropertyWidgetProxy()
42void PropertyWidgetProxy::setPropertyType(
int propertyType)
44 m_propertyType =
static_cast<PropertyType
>(propertyType);
48void PropertyWidgetProxy::setPropertyType2(PropertyType propertyType)
50 m_propertyType = propertyType;
54void PropertyWidgetProxy::setWidget()
58 p->setType(m_propertyType);
60 m_editor = PropertyMachineFactory::getInstance()->machineForProperty(mp)->propertyEditor;
63 m_editor->reparent(
this, TQPoint(0,0),
true);
64 m_layout->addWidget(m_editor);
68TQVariant PropertyWidgetProxy::value()
const
71 return m_editor->value();
76void PropertyWidgetProxy::setValue(
const TQVariant &value)
79 m_editor->setValue(value,
false);
82bool PropertyWidgetProxy::setProperty(
const char * name,
const TQVariant & value )
84 if( strcmp( name,
"value") == 0 )
86 setPropertyType((
int) value.type() );
91 return TQWidget::setProperty(name, value);
94TQVariant PropertyWidgetProxy::property(
const char * name )
const
96 if( strcmp( name,
"value") == 0 )
99 return TQWidget::property(name);
105#include "propertywidgetproxy.moc"
Holds a list of properties with the same name and type.
Namespace which contain property editing classes.
Contains PropertyLib::PropertyMachineFactory class and PropertyLib::Machine structure.