[Paraview] Using the accept button from a pqObjectPanel

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Thu Jun 12 15:53:45 EDT 2008


Hmm, I can't think of any easy way to achieve that.
One hackish way is to go up the Qt parent tree for the panel till you 
hit a pqObjectInspectorWidget. I think pqObjectInspectorWidget is indeed 
the parent of the panel. Once you have the
pqObjectInspectorWidget you can call the appropriate slot on it. 
Ofcourse, this is just a hack, so try at your own risk :).

Utkarsh

Paul Edwards wrote:
> Calling apply on itself doesn't work until apply is first pressed by
> the "proper" button (and I don't think it works with undo either).
> The reader/filter I have written is an interface for meshing software
> and the panel on the side is too small for all the options so I have
> created a separate dialog (that pops up from a push button).  The
> dialog has 3 buttons; ok, apply and cancel.  I could just let the user
> press the usual "Accept" but I like the option of having the buttons
> in the dialog so the user doesn't need to switch windows.
> 
> Regards,
> Paul
> 
> 2008/6/12 Utkarsh Ayachit <utkarsh.ayachit at kitware.com>:
>> This is generally not recommended. An object panel cannot cause an "Apply"
>> or a "Reset" since the user could have un-applied changes to other panels as
>> well.
>>
>> If absolutely needed, to push changes made in the panel alone, that can call
>> "apply()" on itself. The apply button's modified state should update
>> correctly depending on whether any other panels are modified (I think).
>>
>> What is your use-case? Why does the panel need to cause an Apply?
>>
>> Utkarsh
>>
>> Paul Edwards wrote:
>>> My pqObjectPanel has a dialog which provides an editor for my filter.
>>> I would like to apply or reset changes from my dialog (or
>>> pqObjectPanel) but (I think) this requires a call to
>>> "pqObjectInspectorWidget::accept" or "pqObjectInspectorWidget::reset".
>>>  I cannot work out how to get a pointer to pqObjectInspector from my
>>> pqObjectPanel.
>>>
>>> Can any help (or suggest another way)?
>>>
>>> Thanks,
>>> Paul
>>> _______________________________________________
>>> ParaView mailing list
>>> ParaView at paraview.org
>>> http://www.paraview.org/mailman/listinfo/paraview
>>>
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview
> 


More information about the ParaView mailing list