ParamterTree

33 views
Skip to first unread message

b. bb

unread,
May 20, 2019, 10:04:32 AM5/20/19
to pyqtgraph
Hi,
I'm writing a program to calculate and display a large number of curves. These are structured in several groups of the same type. Now I like to select each curve separately or pressing one button for showing all respectively another button to hide all curves. How can it be done that the function 'changes()' is called only once?

Thanks,
Ben
parametertree_question.py

Patrick

unread,
May 21, 2019, 2:19:02 AM5/21/19
to pyqtgraph
Hi,

So you want the sigTreeStateChanged signal to only be fired once when calling the checkAllBools/unCheckAllBools methods? In that case, you could do something like 

    def checkAllBools(self):
        p
.blockSignals(True)
       
for plt in self.pSelectBoolItems.groupItems1:
            plt
.setValue(True)
       
for plt in self.pSelectBoolItems.groupItems2:
            plt
.setValue(True)
       
for plt in self.pSelectBoolItems.groupItems3:
            plt
.setValue(True)
        p
.blockSignals(False)
        changes
()

Basically, suppress the triggering of the signals during the method, then call changes() manually.

Patrick

b. bb

unread,
May 21, 2019, 7:00:22 AM5/21/19
to pyqtgraph
Hi Patrick,

Thank you! That was the right hint.

Ben
Reply all
Reply to author
Forward
0 new messages