diff --git a/src/plugins/miscellaneous/Core/src/propertyeditorwidget.cpp b/src/plugins/miscellaneous/Core/src/propertyeditorwidget.cpp index df79bc8c47..acdec20f8a 100644 --- a/src/plugins/miscellaneous/Core/src/propertyeditorwidget.cpp +++ b/src/plugins/miscellaneous/Core/src/propertyeditorwidget.cpp @@ -492,6 +492,15 @@ Property::Property(const Type &pType, PropertyEditorWidget *pParent) : //============================================================================== +PropertyEditorWidget * Property::owner() const +{ + // Return our owner + + return mOwner; +} + +//============================================================================== + Property::Type Property::type() const { // Return our type diff --git a/src/plugins/miscellaneous/Core/src/propertyeditorwidget.h b/src/plugins/miscellaneous/Core/src/propertyeditorwidget.h index ed7f9740c2..c0917d2f9e 100644 --- a/src/plugins/miscellaneous/Core/src/propertyeditorwidget.h +++ b/src/plugins/miscellaneous/Core/src/propertyeditorwidget.h @@ -218,6 +218,8 @@ class CORE_EXPORT Property : public QObject explicit Property(const Type &pType, PropertyEditorWidget *pParent); + PropertyEditorWidget * owner() const; + Type type() const; QStandardItem * parent() const; diff --git a/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewinformationgraphpanelandgraphswidget.cpp b/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewinformationgraphpanelandgraphswidget.cpp index 1410595fe3..a274b6434c 100644 --- a/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewinformationgraphpanelandgraphswidget.cpp +++ b/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewinformationgraphpanelandgraphswidget.cpp @@ -291,7 +291,7 @@ void SimulationExperimentViewInformationGraphPanelAndGraphsWidget::initialize(Op // Keep track of when the user changes a property value connect(mGraphPanelPropertyEditor, SIGNAL(propertyChanged(Core::Property *)), - this, SLOT(graphPanelPropertyChanged())); + this, SLOT(graphPanelPropertyChanged(Core::Property *))); connect(mGraphsPropertyEditor, SIGNAL(propertyChanged(Core::Property *)), this, SLOT(graphsPropertyChanged(Core::Property *))); @@ -1184,59 +1184,60 @@ void SimulationExperimentViewInformationGraphPanelAndGraphsWidget::graphPanelSec //============================================================================== -void SimulationExperimentViewInformationGraphPanelAndGraphsWidget::graphPanelPropertyChanged() +void SimulationExperimentViewInformationGraphPanelAndGraphsWidget::graphPanelPropertyChanged(Core::Property *pProperty) { // Update our graph panel settings - GraphPanelWidget::GraphPanelPlotWidget *graphPanelPlot = mGraphPanels.value(mGraphPanelPropertyEditor)->plot(); + Core::PropertyEditorWidget *propertyEditor = pProperty->owner(); + GraphPanelWidget::GraphPanelPlotWidget *graphPanelPlot = mGraphPanels.value(propertyEditor)->plot(); graphPanelPlot->setUpdatesEnabled(false); - graphPanelPlot->setBackgroundColor(mGraphPanelPropertyEditor->properties()[0]->colorValue()); - graphPanelPlot->setFontSize(mGraphPanelPropertyEditor->properties()[1]->integerValue()); - graphPanelPlot->setForegroundColor(mGraphPanelPropertyEditor->properties()[2]->colorValue()); + graphPanelPlot->setBackgroundColor(propertyEditor->properties()[0]->colorValue()); + graphPanelPlot->setFontSize(propertyEditor->properties()[1]->integerValue()); + graphPanelPlot->setForegroundColor(propertyEditor->properties()[2]->colorValue()); // Grid lines - Core::Property *gridLinesStyleProperty = mGraphPanelPropertyEditor->properties()[3]->properties()[0]; + Core::Property *gridLinesStyleProperty = propertyEditor->properties()[3]->properties()[0]; graphPanelPlot->setGridLinesStyle(Qt::PenStyle(gridLinesStyleProperty->listValues().indexOf(gridLinesStyleProperty->listValue()))); - graphPanelPlot->setGridLinesWidth(mGraphPanelPropertyEditor->properties()[3]->properties()[1]->integerValue()); - graphPanelPlot->setGridLinesColor(mGraphPanelPropertyEditor->properties()[3]->properties()[2]->colorValue()); + graphPanelPlot->setGridLinesWidth(propertyEditor->properties()[3]->properties()[1]->integerValue()); + graphPanelPlot->setGridLinesColor(propertyEditor->properties()[3]->properties()[2]->colorValue()); // Point coordinates - Core::Property *pointCoordinatesStyleProperty = mGraphPanelPropertyEditor->properties()[4]->properties()[0]; + Core::Property *pointCoordinatesStyleProperty = propertyEditor->properties()[4]->properties()[0]; graphPanelPlot->setPointCoordinatesStyle(Qt::PenStyle(pointCoordinatesStyleProperty->listValues().indexOf(pointCoordinatesStyleProperty->listValue()))); - graphPanelPlot->setPointCoordinatesWidth(mGraphPanelPropertyEditor->properties()[4]->properties()[1]->integerValue()); - graphPanelPlot->setPointCoordinatesColor(mGraphPanelPropertyEditor->properties()[4]->properties()[2]->colorValue()); - graphPanelPlot->setPointCoordinatesFontColor(mGraphPanelPropertyEditor->properties()[4]->properties()[3]->colorValue()); + graphPanelPlot->setPointCoordinatesWidth(propertyEditor->properties()[4]->properties()[1]->integerValue()); + graphPanelPlot->setPointCoordinatesColor(propertyEditor->properties()[4]->properties()[2]->colorValue()); + graphPanelPlot->setPointCoordinatesFontColor(propertyEditor->properties()[4]->properties()[3]->colorValue()); // Title - graphPanelPlot->setTitle(mGraphPanelPropertyEditor->properties()[5]->value()); + graphPanelPlot->setTitle(propertyEditor->properties()[5]->value()); // X axis - graphPanelPlot->setLogAxisX(mGraphPanelPropertyEditor->properties()[6]->properties()[0]->booleanValue()); - graphPanelPlot->setTitleAxisX(mGraphPanelPropertyEditor->properties()[6]->properties()[1]->value()); + graphPanelPlot->setLogAxisX(propertyEditor->properties()[6]->properties()[0]->booleanValue()); + graphPanelPlot->setTitleAxisX(propertyEditor->properties()[6]->properties()[1]->value()); // Y axis - graphPanelPlot->setLogAxisY(mGraphPanelPropertyEditor->properties()[7]->properties()[0]->booleanValue()); - graphPanelPlot->setTitleAxisY(mGraphPanelPropertyEditor->properties()[7]->properties()[1]->value()); + graphPanelPlot->setLogAxisY(propertyEditor->properties()[7]->properties()[0]->booleanValue()); + graphPanelPlot->setTitleAxisY(propertyEditor->properties()[7]->properties()[1]->value()); // Zoom region - Core::Property *zoomRegionStyleProperty = mGraphPanelPropertyEditor->properties()[8]->properties()[0]; + Core::Property *zoomRegionStyleProperty = propertyEditor->properties()[8]->properties()[0]; graphPanelPlot->setZoomRegionStyle(Qt::PenStyle(zoomRegionStyleProperty->listValues().indexOf(zoomRegionStyleProperty->listValue()))); - graphPanelPlot->setZoomRegionWidth(mGraphPanelPropertyEditor->properties()[8]->properties()[1]->integerValue()); - graphPanelPlot->setZoomRegionColor(mGraphPanelPropertyEditor->properties()[8]->properties()[2]->colorValue()); - graphPanelPlot->setZoomRegionFontColor(mGraphPanelPropertyEditor->properties()[8]->properties()[3]->colorValue()); - graphPanelPlot->setZoomRegionFilled(mGraphPanelPropertyEditor->properties()[8]->properties()[4]->booleanValue()); - graphPanelPlot->setZoomRegionFillColor(mGraphPanelPropertyEditor->properties()[8]->properties()[5]->colorValue()); + graphPanelPlot->setZoomRegionWidth(propertyEditor->properties()[8]->properties()[1]->integerValue()); + graphPanelPlot->setZoomRegionColor(propertyEditor->properties()[8]->properties()[2]->colorValue()); + graphPanelPlot->setZoomRegionFontColor(propertyEditor->properties()[8]->properties()[3]->colorValue()); + graphPanelPlot->setZoomRegionFilled(propertyEditor->properties()[8]->properties()[4]->booleanValue()); + graphPanelPlot->setZoomRegionFillColor(propertyEditor->properties()[8]->properties()[5]->colorValue()); graphPanelPlot->setUpdatesEnabled(true); diff --git a/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewinformationgraphpanelandgraphswidget.h b/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewinformationgraphpanelandgraphswidget.h index c52cae6920..991e9ceed7 100644 --- a/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewinformationgraphpanelandgraphswidget.h +++ b/src/plugins/simulation/SimulationExperimentView/src/simulationexperimentviewinformationgraphpanelandgraphswidget.h @@ -202,7 +202,7 @@ private slots: void graphPanelSectionExpanded(const QModelIndex &pIndex); void graphPanelSectionCollapsed(const QModelIndex &pIndex); - void graphPanelPropertyChanged(); + void graphPanelPropertyChanged(Core::Property *pProperty); void graphsPropertyChanged(Core::Property *pProperty); void updateParameterValue();