Beispiel #1
0
 def treeStateChanged(self, param, changes):
     ## catch changes to 'sequence' so we can hide/show other params.
     ## Note: it would be easier to just catch self.sequence.sigValueChanged,
     ## but this approach allows us to block tree change events so they are all
     ## released as a single update.
     with self.treeChangeBlocker():
         ## queue up change 
         SimpleParameter.treeStateChanged(self, param, changes)
         
         ## if needed, add some more changes before releasing the signal
         for param, change, data in changes:
             ## if the sequence value changes, hide/show other parameters
             if param is self.param('sequence') and change == 'value':
                 vis = self.visibleParams[self['sequence']]
                 for ch in self:
                     if ch.name() in vis:
                         ch.show()
                     else:
                         ch.hide()
Beispiel #2
0
    def treeStateChanged(self, param, changes):
        ## catch changes to 'sequence' so we can hide/show other params.
        ## Note: it would be easier to just catch self.sequence.sigValueChanged,
        ## but this approach allows us to block tree change events so they are all
        ## released as a single update.
        with self.treeChangeBlocker():
            ## queue up change
            SimpleParameter.treeStateChanged(self, param, changes)

            ## if needed, add some more changes before releasing the signal
            for param, change, data in changes:
                ## if the sequence value changes, hide/show other parameters
                if param is self.param('sequence') and change == 'value':
                    vis = self.visibleParams[self['sequence']]
                    for ch in self:
                        if ch.name() in vis:
                            ch.show()
                        else:
                            ch.hide()