Comments (1)
I investigated the issue myself already and could trace the origin via the following call stack:
In DockArea.restoreState .buildFromState is called.
buildFromState builds the container layout recursively.
When it builds the vertical container containing Plot 1 it calls obj.apoptose(propagate=False)
.
Here the dock widget is inserted in the parent container and removed from its original container: https://github.com/pyqtgraph/pyqtgraph/blob/master/pyqtgraph/dockarea/Container.py#L71
Finally the container change is propagated via the call to containerChanged(self)
: https://github.com/pyqtgraph/pyqtgraph/blob/master/pyqtgraph/dockarea/Container.py#L54
And here finally is the culprit: apoptose() is called on the original container without any arguments: https://github.com/pyqtgraph/pyqtgraph/blob/master/pyqtgraph/dockarea/Dock.py#L213
This means propagate is True, as can be seen here: https://github.com/pyqtgraph/pyqtgraph/blob/master/pyqtgraph/dockarea/Container.py#L60
So, since there is only one element in the container currently and all parent containers have only one element as well, because we're in the middle of constructing the container tree, the entire tree is compacted into only one container and the dock itself.
Now, the container in the further state restoration are missing and therefore not visible and even garbage collected.
Changing Line 213 in Dock.py to self._container.apoptose(propagate=False)
fixes the issue and all docks are correctly restored.
The problem is I don't know if this was merely forgotten there, because it is no usual case, that a container has only 1 element or is it necessary because something else would break, which I'm not aware of.
Anyone has any idea?
from pyqtgraph.
Related Issues (20)
- Can't add menu item to non-removable ROI
- PolyLineROI.setPoints() causes signal spam
- Mouse Coordinates Do Not Update Correctly for Non-Square Images in PyQtGraph's ImageView HOT 1
- SVG Exporter Moves PlotObjects HOT 1
- Increasing width of the Parameter column in parameter trees HOT 1
- Parameter Lists : porting to 0.13.4
- TypeError when adding items to histogram menu in 0.13.4 HOT 3
- PyQtGraph 0.1.14 takes approximately twice as long to plot colored points in a ScatterPlotItem that 0.1.13 HOT 7
- Colormap plot scatter points HOT 2
- SyntaxWarnings HOT 1
- 'DateAxisItem' object has no attribute 'fontMetrics' HOT 3
- `DateAxisItem` renders correctly only for one plot if re-added HOT 1
- Errors encountered when running tests on risc-v platform HOT 4
- 'NoneType' object has no attribute 'removeItem' HOT 1
- ConsoleWidget.write() function missing HOT 6
- TypeError exception in ROI raiseContextMenu . QPoint being sent floats instead of ints HOT 14
- ParameterTree Example Generated Deprecation Warning HOT 1
- Test failure on test_PolyLineROI on arm64
- parameterTree contents are not displayed on the correct position when the parameterTree widget has scroll bars HOT 4
- GraphicsScene.mouseMoveEvent duplicates events
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyqtgraph.