Commit 1bb97e78 authored by Kyle Lutz's avatar Kyle Lutz
Browse files

Use custom panel_widget settings in createWidgetForProperty()

This changes the pqPropertiesPanel::createWidgetForProperty() method
to look through the pqPropertyWidgetInterface implementations when
creating property widgets.

Change-Id: If1e6f8d56f239555b6a5633d57ec0986c2c46b07
parent 5f490998
......@@ -446,6 +446,22 @@ pqPropertyWidget* pqPropertiesPanel::createWidgetForProperty(vtkSMProperty *prop
vtkSMProxy *proxy,
QWidget *parent)
{
// check for custom widgets
pqInterfaceTracker *interfaceTracker =
pqApplicationCore::instance()->interfaceTracker();
foreach(pqPropertyWidgetInterface *interface,
interfaceTracker->interfaces<pqPropertyWidgetInterface *>())
{
pqPropertyWidget *widget =
interface->createWidgetForProperty(proxy, property);
if(widget)
{
// stop if we successfully created a property widget
return widget;
}
}
if(vtkSMDoubleVectorProperty *dvp = vtkSMDoubleVectorProperty::SafeDownCast(property))
{
return new pqDoubleVectorPropertyWidget(dvp, proxy, parent);
......@@ -1187,24 +1203,9 @@ QList<pqPropertiesPanelItem> pqPropertiesPanel::createWidgetsForProxy(pqProxy *p
continue;
}
pqPropertyWidget *propertyWidget = 0;
pqInterfaceTracker *interfaceTracker = pqApplicationCore::instance()->interfaceTracker();
foreach(pqPropertyWidgetInterface *interface, interfaceTracker->interfaces<pqPropertyWidgetInterface *>())
{
propertyWidget = interface->createWidgetForProperty(smProxy, smProperty);
if(propertyWidget)
{
// stop if we successfully created a property widget
break;
}
}
if(!propertyWidget)
{
propertyWidget = this->createWidgetForProperty(smProperty, smProxy, this);
}
// create property widget
pqPropertyWidget *propertyWidget =
this->createWidgetForProperty(smProperty, smProxy, this);
if(propertyWidget)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment