You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an application with instances of pyface.tasks.api.DockPane.
When one of these DockPanes is undocked from the main window and then the app is closed, we get the following traceback:
2020-11-30 09:29:19,075 ERROR [traits:221] Exception occurred in traits notification handler for object: <envisage.ui.tasks.task_window.TaskWindow object at 0x7fa8a79223b8>, trait: closing, old value: <undefined>, new value: <traits.has_traits.Vetoable object at 0x7fa88a537830>
Traceback (most recent call last):
File "/Users/sparsons/.edm/envs/dev/lib/python3.6/site-packages/traits/trait_notifiers.py", line 522, in _dispatch_change_event
self.dispatch(handler, *args)
File "/Users/sparsons/.edm/envs/dev/lib/python3.6/site-packages/traits/trait_notifiers.py", line 484, in dispatch
handler(*args)
File "/Users/sparsons/.edm/envs/dev/lib/python3.6/site-packages/envisage/ui/tasks/tasks_application.py", line 479, in _on_window_closing
window_layout = window.get_window_layout()
File "/Users/sparsons/.edm/envs/dev/lib/python3.6/site-packages/pyface/tasks/task_window.py", line 312, in get_window_layout
layout = self._window_backend.get_layout()
File "/Users/sparsons/.edm/envs/dev/lib/python3.6/site-packages/pyface/ui/qt4/tasks/task_window_backend.py", line 92, in get_layout
self._main_window_layout.get_layout(layout)
File "/Users/sparsons/.edm/envs/dev/lib/python3.6/site-packages/pyface/ui/qt4/tasks/main_window_layout.py", line 58, in get_layout
sublayout = self.get_layout_for_area(q_dock_area, include_sizes)
File "/Users/sparsons/.edm/envs/dev/lib/python3.6/site-packages/pyface/ui/qt4/tasks/main_window_layout.py", line 132, in get_layout_for_area
"Unable to extract layout from QMainWindow."
RuntimeError: Unable to extract layout from QMainWindow.
It seems that when the when the app is closed (envisage.ui.tasks.tasks_application.TasksApplication._on_window_closing) it tries to get the window layout for saving (pyface.ui.qt4.tasks.main_window_layout.MainWindowLayout.get_layout_for_area) but this throws an error, presumably because the undocked pane is not found.
As the app is closing anyway, it has no harmful effects, but it is a bit off-putting to get a RuntimeError. A band-aid might be to catch the error at TasksApplication._on_window_closing (or force docking of panes before getting the layout ?).
I put this as an Envisage issue, rather than Pyface, as it has its root at envisage.ui.tasks.tasks_application.TasksApplication._on_window_closing.
The text was updated successfully, but these errors were encountered:
We have an application with instances of
pyface.tasks.api.DockPane
.When one of these
DockPane
s is undocked from the main window and then the app is closed, we get the following traceback:It seems that when the when the app is closed (
envisage.ui.tasks.tasks_application.TasksApplication._on_window_closing
) it tries to get the window layout for saving (pyface.ui.qt4.tasks.main_window_layout.MainWindowLayout.get_layout_for_area
) but this throws an error, presumably because the undocked pane is not found.As the app is closing anyway, it has no harmful effects, but it is a bit off-putting to get a RuntimeError. A band-aid might be to catch the error at
TasksApplication._on_window_closing
(or force docking of panes before getting the layout ?).I put this as an Envisage issue, rather than Pyface, as it has its root at
envisage.ui.tasks.tasks_application.TasksApplication._on_window_closing
.The text was updated successfully, but these errors were encountered: