[Paraview-developers] checked and unchecked properties

Biddiscombe, John A. biddisco at cscs.ch
Thu Jan 20 11:24:56 EST 2011


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20110120/db982700/attachment-0001.htm>


More information about the Paraview-developers mailing list