[Paraview-developers] checked and unchecked properties

Biddiscombe, John A. biddisco at cscs.ch
Fri Jan 21 04:11:59 EST 2011


Utkarsh 

Thanks again for the info. I think I see how it all fits together. I've not used the adaptors, but I may take a look at the SIL stuff too as that has a custom widget, but without the adaptor.

cheers

JB


-----Original Message-----
From: Utkarsh Ayachit [mailto:utkarsh.ayachit at kitware.com] 
Sent: 20 January 2011 19:40
To: Biddiscombe, John A.
Cc: paraview-developers at paraview.org
Subject: Re: [Paraview-developers] checked and unchecked properties

For property linking the things to remember are:
* you need a Qt property on the widget that you can set/get when the
SMProperty changes or the Qt widget changes (due to user interaction).
* you need a signal on the widget that gets fired when the widget changes.
* you need to ensure that pqSMAdaptor and get/set values from your
custom SMProperty.

Look at the handling of pqSMAdaptor::COMPOSITE_TREE type in
pqNamedWidgets as an example. It uses an adaptor, but the
signals/qt-property can be defined on the widget itself as well.

Utkarsh

Then in your code where you are creating the widget, you just need to
hook up the widget and the property with the propertyManager()

On Thu, Jan 20, 2011 at 11:24 AM, Biddiscombe, John A. <biddisco at cscs.ch> wrote:
> Whilst I've got your attention....
>
>
>
> Suppose I want to create a widget with a field array list, and a button, and
> another small control, and I have a custom property
>
> vtkSMDataArrayProperty (a subclass of vtkStringVectorProperty), if I create
> a small pqPanel to encapsulate the behaviour I want, can i get it created
> automatically when the pqNamedObjects stuff is run.
>
>
>
> What I'm after is (simplified)
>
> vtkCustomBooleanProperty
>
> to create a small gui control of my creation instead of a checkbox, so that
> inside the pqNamedWidgets, my control is generated
>
>
>
> I manually changed the code to allow one special one already
>
>     else if(pt == pqSMAdaptor::ENUMERATION)
>
>       {
>
>       if (SMProperty->IsA("vtkSMCommandProperty"))
>
>         {
>
>         QPushButton* button;
>
>         button = new QPushButton(propertyLabel,
> panelLayout->parentWidget());
>
>         button->setCheckable(1);
>
>         button->setObjectName(propertyName);
>
>         panelLayout->addWidget(button, rowCount, 0, 1, 2);
>
>         button->show();
>
>         rowCount++;
>
>         }
>
> so I can have a button instead of a checkbox for a vtkSMCommandProperty
> (such as "restart simulation"), but now I need a more complex control with a
> field array selection, and a button and some other stuff. I'm sure I can
> stuff my own widget in there if I want, but I'm worried about the connection
> of the events and property updates. Are there any other complex sub-controls
> anywhere that I can crib off ? I'm happy to hack quite deeply.
>
>
>
> JB
>
>
>
> -----Original Message-----
> From: paraview-developers-bounces at paraview.org
> [mailto:paraview-developers-bounces at paraview.org] On Behalf Of Biddiscombe,
> John A.
> Sent: 20 January 2011 17:08
> To: Utkarsh Ayachit
> Cc: paraview-developers at paraview.org
> Subject: Re: [Paraview-developers] checked and unchecked properties
>
>
>
> Utkarsh
>
>
>
> It's like someone just lifted a blanket off my head. I see so much more
> clearly now.
>
>
>
> Cheers. As always, you're a great help.
>
>
>
> JB
>
>
>
> -----Original Message-----
>
> From: Utkarsh Ayachit [mailto:utkarsh.ayachit at kitware.com]
>
> Sent: 20 January 2011 16:38
>
> To: Biddiscombe, John A.
>
> Cc: paraview-developers at paraview.org
>
> Subject: Re: [Paraview-developers] checked and unchecked properties
>
>
>
> unchecked property values are not pushed or saved in state or
>
> anything. They are only used by domains to update themselves. The GUI
>
> sets them when the user changes a GUI widget before hitting apply,
>
> without changing the actual property value.
>
>
>
> e.g. ArrayListDomain needs the field-selection property to show either
>
> cell or point arrays. Now in the GUI when the user changes the field
>
> selection to "cell" he expected to see the cell arrays listed even
>
> before he has hit apply. For that, the ArrayListDomain needs to use
>
> the user-selected value, not the actual property value. In such cases,
>
> the GUI sets the unchecked value for the property and updates the
>
> domain.
>
>
>
> Utkarsh
>
>
>
> On Thu, Jan 20, 2011 at 10:16 AM, Biddiscombe, John A. <biddisco at cscs.ch>
> wrote:
>
>> Can anyone tell me the difference between checked and unchecked properties
>> (and for example in classes like StringVectorProperty there are unchecked
>> elements etc).
>
>>
>
>> What is the distinction. I may have asked before, but if so ... I've
>> forgotten.
>
>>
>
>> thanks
>
>>
>
>> JB
>
>>
>
>>
>
>> --
>
>> John Biddiscombe,                            email:biddisco @ cscs.ch
>
>> http://www.cscs.ch/
>
>> CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
>
>> Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82
>
>>
>
>>
>
>> _______________________________________________
>
>> Paraview-developers mailing list
>
>> Paraview-developers at paraview.org
>
>> http://public.kitware.com/mailman/listinfo/paraview-developers
>
>>
>
> _______________________________________________
>
> Paraview-developers mailing list
>
> Paraview-developers at paraview.org
>
> http://public.kitware.com/mailman/listinfo/paraview-developers


More information about the Paraview-developers mailing list