cdd1969 / pygwa

Ground Water Analyzer tool for Hydrographs. flowchart, python, pyqtgraph, pyqt
GNU General Public License v2.0
7 stars 0 forks source link

RestoreState in node `Join Columns` #11

Open cdd1969 opened 8 years ago

cdd1969 commented 8 years ago

Dont know how to make children appear after restoreState.

Currently i cheat re-implementing this method:

    def restoreState(self, state, **kwargs):
        # for some reason normal state restore eats children > simply add param once again
        self.p.clearChildren()
        self.p.addChild(ScalableGroup(title='Columns to add from B', name='grp'))
        self.disconnect_valueChanged2upd(self.param('grp'))
        self.param('grp').sigChildAdded.connect(self._parent.update)
        self.param('grp').sigChildRemoved.connect(self._parent.update)

but if default restoreState method is used following Error occurs

Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/pyqtgraph/parametertree/ParameterItem.py", line 100, in childRemoved if item.param is child: AttributeError: 'QTreeWidgetItem' object has no attribute 'param'