With many thanks to your hints, I also dug around to see what command_button
was doing and this corresponds nicely what I needed. I'll put it here for
anyone browsing the archives.
void fireCommand(vtkSMProperty* prop)
vtkSMProxy* pxy = this->proxy();
void fireCommand(vtkSMIntVectorProperty* prop, bool checked)
vtkSMProxy* pxy = this->proxy();
prop->SetElement(0, checked); // Toogle bool
From: Utkarsh Ayachit <utkarsh.ayac...@kitware.com>
Sent: Tuesday, January 10, 2017 9:05 PM
To: Mark Olesen
Subject: Re: [Paraview] upgrading reader module/plugin
After you've changed a property, you need to call
vtkSMProxy::UpdateVTKObjects() (or vtkSMProxy::UpdateProperty()) to
push those values for them to have any effect. However, in a panel,
you'd rather not do that.
On Mon, Jan 9, 2017 at 12:31 PM, Mark Olesen <mark.ole...@esi-group.com> wrote:
> The SetImmediateUpdate seems be needed for cases where I do bypass the
> addPropertyLink mechanism. Eg,
> QCheckBox* b = new QCheckBox(this);
> setButtonProperties(b, showPointNumbers_); //<- text, tips etc...
> form->addWidget(b, 0, 1, Qt::AlignLeft);
> connect(b, SIGNAL(toggled(bool)), this, SLOT(showPointNumbers(bool)));
> and then
> void pqFoamBlockMeshControls::showPointNumbers(bool checked)
> showPointNumbers_->SetElement(0, checked);
> // Update the active view
> if (this->view())
> Without the SetImmediateUpdate, the toggle of the showPointNumbers property
> doesn't get propagated to the reader until sometime later. Maybe the key is
> to signal directly to the reader?
> From: Utkarsh Ayachit <utkarsh.ayac...@kitware.com>
> Sent: Monday, January 9, 2017 4:18 PM
> To: Mark Olesen
> Cc: firstname.lastname@example.org
> Subject: Re: [Paraview] upgrading reader module/plugin
> I don't think `SetImmediateUpdate` should be needed any more. Are you
> sure it's needed? If I remember correctly, it's one of the obselete
> ivars that should truly be deprecated and removed.
> On Mon, Jan 9, 2017 at 4:10 AM, Mark Olesen <mark.ole...@esi-group.com> wrote:
>> Hi Utkarsh,
>> The addPropertyLink works exactly as desired and triggers the necessary
>> update mechanism. For a few places I still have direct connect() to catch
>> the signal and do something additional with it, but that was expected. I
>> don't know why I still need an SetImmediateUpdate to get the changes
>> propagated properly, but that can wait. The most important thing is that I
>> can now load my reader module in paraview 5.2 and move forward.
>> Thank you,
>> From: Utkarsh Ayachit <utkarsh.ayac...@kitware.com>
>> Sent: Thursday, January 5, 2017 4:52:32 AM
>> To: Mark Olesen
>> Cc: email@example.com
>> Subject: Re: [Paraview] upgrading reader module/plugin
>> As you can expect, connecting Qt widgets to vtkSMProperty's on proxies
>> in a two-way-link is common in ParaView panels and hence ParaView
>> provides quite a few ways for doing that. For your use-case, where
>> you're connecting a QCheckBox to an IntVectorProperty on the proxy,
>> your pqPropertyWidget subclass can do something like the following:
>> Assuming your XML for the group is as follows:
>> QCheckBox *checkbox = ...
>> vtkSMProperty* smProperty = smgroup->GetProperty("InterpolateFields");
>> this->addPropertyLink(checkbox, "checked", SIGNAL(toggled(bool), smProperty);
>> That should do it.
>> On Wed, Jan 4, 2017 at 9:48 AM, Mark Olesen <mark.ole...@esi-group.com>
>>> I'm currently upgrading a reader module from using a
>>> pqAutoGeneratedObjectPanel to a using a property group widget (as per
>>> I have my bunch of properties in a PropertyGroup and have a panel_widget
>>> associated with them. Everything loads up, and using printf() I can verify
>>> that the property values are all being updated.
>>> However, not only does it seems rather clunky, I cannot get the "Apply"
>>> button on the property panel to notice when the property values have been
>>> Here's a basic sketch of what I have:
>>> // Get the property from the group (with down-cast):
>>> interpolateFields_ = group->GetProperty("interpolate");
>>> // Provide a checkbox as widget for it - two-column layout.
>>> QCheckBox* b = new QCheckBox(prop->GetXMLLabel(), this);
>>> form->addWidget(b, row, col, Qt::AlignLeft);
>>> // Connect to slot:
>>> connect(b, SIGNAL(toggled(bool)), this, SLOT(interpolateFields(bool)));
>>> // This is ugly, but seems to be needed???
>>> // And the slot itself
>>> void interpolateFields(bool checked)
>>> interpolateFields_->SetElement(0, checked);
>>> // this->setModified();
>>> //^^^ used to work with pqAutoGeneratedObjectPanel
>>> I used to rely on the setModified() method from the
>>> pqAutoGeneratedObjectPanel, but now can't seem to get from the SMproxy to
>>> the pqProxy or whatever.
>>> Or am I going about this entirely the wrong way?
>>> FWIW, here are the relevant sub-entries from the XML, in case there is
>>> something missing there:
>>> <BooleanDomain name="bool"/>
>>> label="General Controls"
>>> <Property name="InterpolateFields"/>
>>> Unfortunately, the Examples/Plugins/PropertyWidgets is a bit scanty here.
>>> Thanks for any advice,
>>> Powered by www.kitware.com
>>> Visit other Kitware open-source projects at
>>> Please keep messages on-topic and check the ParaView Wiki at:
>>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>> Follow this link to subscribe/unsubscribe:
Powered by www.kitware.com
Visit other Kitware open-source projects at
Please keep messages on-topic and check the ParaView Wiki at:
Search the list archives at: http://markmail.org/search/?q=ParaView
Follow this link to subscribe/unsubscribe: