Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
8069c04f
Commit
8069c04f
authored
6 years ago
by
Ian Bush
Browse files
Options
Downloads
Patches
Plain Diff
Refs #22518 Wrap further methods in QAppThreadCalls
This avoids a crash on Windows when changing a figure name
parent
fc7cb7c7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
qt/applications/workbench/workbench/plotting/figuremanager.py
+13
-1
13 additions, 1 deletion
...pplications/workbench/workbench/plotting/figuremanager.py
qt/applications/workbench/workbench/widgets/plotselector/view.py
+2
-0
2 additions, 0 deletions
...ications/workbench/workbench/widgets/plotselector/view.py
with
15 additions
and
1 deletion
qt/applications/workbench/workbench/plotting/figuremanager.py
+
13
−
1
View file @
8069c04f
...
@@ -81,13 +81,17 @@ class FigureManagerWorkbench(FigureManagerBase, QObject):
...
@@ -81,13 +81,17 @@ class FigureManagerWorkbench(FigureManagerBase, QObject):
self
.
_window_activated
=
QAppThreadCall
(
self
.
_window_activated_orig
)
self
.
_window_activated
=
QAppThreadCall
(
self
.
_window_activated_orig
)
self
.
_widgetclosed_orig
=
self
.
_widgetclosed
self
.
_widgetclosed_orig
=
self
.
_widgetclosed
self
.
_widgetclosed
=
QAppThreadCall
(
self
.
_widgetclosed_orig
)
self
.
_widgetclosed
=
QAppThreadCall
(
self
.
_widgetclosed_orig
)
self
.
set_window_title_orig
=
self
.
set_window_title
self
.
set_window_title
=
QAppThreadCall
(
self
.
set_window_title_orig
)
self
.
fig_visibility_changed_orig
=
self
.
fig_visibility_changed
self
.
fig_visibility_changed
=
QAppThreadCall
(
self
.
fig_visibility_changed_orig
)
self
.
canvas
=
canvas
self
.
canvas
=
canvas
self
.
window
=
MainWindow
()
self
.
window
=
MainWindow
()
self
.
window
.
activated
.
connect
(
self
.
_window_activated
)
self
.
window
.
activated
.
connect
(
self
.
_window_activated
)
self
.
window
.
closing
.
connect
(
canvas
.
close_event
)
self
.
window
.
closing
.
connect
(
canvas
.
close_event
)
self
.
window
.
closing
.
connect
(
self
.
_widgetclosed
)
self
.
window
.
closing
.
connect
(
self
.
_widgetclosed
)
self
.
window
.
visibility_changed
.
connect
(
lambda
plot_number
=
num
:
Gc
f
.
fig
ure
_visibility_changed
(
plot_number
)
)
self
.
window
.
visibility_changed
.
connect
(
sel
f
.
fig_visibility_changed
)
self
.
window
.
setWindowTitle
(
"
Figure %d
"
%
num
)
self
.
window
.
setWindowTitle
(
"
Figure %d
"
%
num
)
self
.
canvas
.
figure
.
set_label
(
"
Figure %d
"
%
num
)
self
.
canvas
.
figure
.
set_label
(
"
Figure %d
"
%
num
)
...
@@ -232,6 +236,14 @@ class FigureManagerWorkbench(FigureManagerBase, QObject):
...
@@ -232,6 +236,14 @@ class FigureManagerWorkbench(FigureManagerBase, QObject):
# to allow getting a handle as plt.figure('Figure Name')
# to allow getting a handle as plt.figure('Figure Name')
self
.
canvas
.
figure
.
set_label
(
title
)
self
.
canvas
.
figure
.
set_label
(
title
)
def
fig_visibility_changed
(
self
):
"""
Make a notification in the global figure manager that
plot visibility was changed. This method is added to this
class so that it can be wrapped in a QAppThreadCall.
"""
Gcf
.
figure_visibility_changed
(
self
.
num
)
# ------------------------ Interaction events --------------------
# ------------------------ Interaction events --------------------
def
on_button_press
(
self
,
event
):
def
on_button_press
(
self
,
event
):
if
not
event
.
dblclick
:
if
not
event
.
dblclick
:
...
...
This diff is collapsed.
Click to expand it.
qt/applications/workbench/workbench/widgets/plotselector/view.py
+
2
−
0
View file @
8069c04f
...
@@ -122,6 +122,8 @@ class PlotSelectorView(QWidget):
...
@@ -122,6 +122,8 @@ class PlotSelectorView(QWidget):
self
.
set_visibility_icon
=
QAppThreadCall
(
self
.
set_visibility_icon_orig
)
self
.
set_visibility_icon
=
QAppThreadCall
(
self
.
set_visibility_icon_orig
)
self
.
set_last_active_values_orig
=
self
.
set_last_active_values
self
.
set_last_active_values_orig
=
self
.
set_last_active_values
self
.
set_last_active_values
=
QAppThreadCall
(
self
.
set_last_active_values_orig
)
self
.
set_last_active_values
=
QAppThreadCall
(
self
.
set_last_active_values_orig
)
self
.
sort_type_orig
=
self
.
sort_type
self
.
sort_type
=
QAppThreadCall
(
self
.
sort_type_orig
)
# Connect presenter methods to things in the view
# Connect presenter methods to things in the view
self
.
show_button
.
clicked
.
connect
(
self
.
presenter
.
show_multiple_selected
)
self
.
show_button
.
clicked
.
connect
(
self
.
presenter
.
show_multiple_selected
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment