Git Product home page Git Product logo

Comments (1)

UsYer avatar UsYer commented on May 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.