New user trying to understand DockArea, save/restore state...

28 views
Skip to first unread message

Jim Crowell

unread,
Mar 19, 2018, 4:04:10 PM3/19/18
to pyqtgraph

My users got excited when I showed them the 'dockarea' demo, so I'm trying to work out how it works under the hood...it looks like it doesn't work well in conjunction with the dock close button? I see restoreState(missing='create') option, but that seems to only create an empty Dock (without inserting it in DockArea.docks, which looks like a bug).

I'm wondering, is there a nice way to re-attach an existing but invisible Widget to a DockArea after restoreState()? I was able to hack it by storing a copy of the original DockArea.docks & replacing missing widgets from it after restoreState()...


Jim Crowell

unread,
Mar 20, 2018, 11:52:02 AM3/20/18
to pyqtgraph
Actually, for my use case the nicest solution looks like making a clone of DockArea.docks, then passing that as
an optional argument to DockArea.restoreState() and DockArea.buildFromState()--allowing it to re-insert an
existing Dock instead of creating a new one.

I've been playing around with this in a fork & it seems to work well enough. Is this something that anyone else might be interested in?
Reply all
Reply to author
Forward
0 new messages