Commit 2bb6de26 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit
Browse files

fixes assert in !2950.

fixes pv.OpenSaveData test failure due to the flags not getting reset
correctly after reset session. that was because we were using QPointer
to check if the representationw as changed, which is not adequate since
QPointer can be nulled externally. fixed by using a void-ptr to catch
change in representation pointer.
parent e1331332
......@@ -622,6 +622,7 @@ public:
QPointer<pqView> View;
QPointer<pqOutputPort> OutputPort;
QPointer<pqDataRepresentation> Representation;
void* RepresentationVoidPtr; // used to check if the ptr changed.
QList<QPair<unsigned int, bool> > BlockVisibilities;
QList<QPair<unsigned int, QVariant> > BlockColors;
......@@ -641,6 +642,7 @@ public:
: CDTModel(new pqCompositeDataInformationTreeModel(self))
, ProxyModel(new MultiBlockInspectorModel(self))
, SelectionModel(new MultiBlockInspectorSelectionModel(this->ProxyModel, this->CDTModel, self))
, RepresentationVoidPtr(nullptr)
, UserCheckable(false)
, HasColors(false)
, HasOpacities(false)
......@@ -945,7 +947,7 @@ void pqMultiBlockInspectorWidget::setOutputPortInternal(pqOutputPort* port)
void pqMultiBlockInspectorWidget::setRepresentation(pqDataRepresentation* repr)
{
pqInternals& internals = (*this->Internals);
if (internals.Representation != repr)
if (internals.RepresentationVoidPtr != repr)
{
if (internals.Representation)
{
......@@ -956,6 +958,7 @@ void pqMultiBlockInspectorWidget::setRepresentation(pqDataRepresentation* repr)
internals.clearCache();
internals.UserCheckable = internals.HasColors = internals.HasOpacities = false;
internals.Representation = repr;
internals.RepresentationVoidPtr = repr;
this->updateScalarColoring();
if (repr)
{
......
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