File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ def drag_mouse(
223223
224224def create_window (
225225 tool_class : type [ToolT ],
226- active_item_type : type [IItemType ] = ICurveItemType ,
226+ active_item_type : type [IItemType ] | None = ICurveItemType ,
227227 panels : list [type [PanelWidget ]] | None = None ,
228228 items : list [QwtPlotItem ] | None = None ,
229229) -> tuple [PlotWindow , ToolT ]:
@@ -245,8 +245,14 @@ def create_window(
245245 plot = win .manager .get_plot ()
246246 for item in items :
247247 plot .set_active_item (item )
248- last_active_item = plot .get_last_active_item (active_item_type )
249- plot .set_active_item (last_active_item )
248+ if active_item_type is None :
249+ plot .unselect_all ()
250+ last_active_item = None
251+ else :
252+ last_active_item = plot .get_last_active_item (active_item_type )
253+ if last_active_item is not None :
254+ plot .set_active_item (last_active_item )
255+
250256 if panels is not None :
251257 for panel in panels :
252258 win .manager .add_panel (panel ())
You can’t perform that action at this time.
0 commit comments