Parameter class Issue - Can't remove and add a child parameter back to the same place
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pyqtgraph |
New
|
Undecided
|
Unassigned |
Bug Description
Hello,
I'm having the following problem with PyQtGraph0.
self.widget.
If we call self.widget.show() in the line before, this exception is raised:
RuntimeError: Internal C++ object (SpinBox) already deleted.
This is a code example that reproduces the problem I'm having:
from pyqtgraph.
from pyqtgraph.Qt import QtGui
from pyqtgraph.
app = QtGui.QApplicat
t2 = ParameterTree()
t2.show()
root = Parameter.
t2.addParameter
par = Parameter.
par.addChildren
root.addChild(par)
par.remove()
root.addChild(par)
QtGui.QApplicat
The problem is that the signals in the Parameter class remain connected to the destroyed ParameterItem. My workaround was to capture the destroy signal of the widget objects and disconnect the ParameterItem signals:
# Disconnect the signals when the widget is gone
def __init___fix(self, param, depth):
ParameterItem.
self.hideWidget = True ## hide edit widget, replace with label when not selected
## set this to False to keep the editor widget always visible
## build widget into column 1 with a display label and default button.
w = self.makeWidget()
self.widget = w
self.widget.
self.widget.
self.widget.
self.widget.
self.widget.
self.widget.
self.widget.
self.widget.
self.eventProxy = EventProxy(w, self.widgetEven
...
WidgetParameter