[ENH] Implement copying graph to clipboard using Ctrl-C (Cmd-C)#1386
[ENH] Implement copying graph to clipboard using Ctrl-C (Cmd-C)#1386kernc merged 1 commit intobiolab:masterfrom
Conversation
Current coverage is 87.73%@@ master #1386 diff @@
==========================================
Files 75 75
Lines 7421 7421
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 6511 6511
Misses 910 910
Partials 0 0
|
Orange/widgets/widget.py
Outdated
| sc = QShortcut(QKeySequence(Qt.ShiftModifier | Qt.Key_F1), self) | ||
| sc.activated.connect(self.__quicktip) | ||
|
|
||
| sc = QShortcut(QKeySequence(Qt.ControlModifier | Qt.Key_C), self) |
There was a problem hiding this comment.
QKeySequence(QKeySequence.Copy)|
Currently segfaults on GNU/Linux. |
| graph_obj = getdeepattr(self, self.graph_name, None) | ||
| if graph_obj is None: | ||
| return | ||
| ClipboardFormat.write_image(None, graph_obj) |
There was a problem hiding this comment.
Can't step through it after here. 😕
There was a problem hiding this comment.
With which visualization? All? Perhaps you should ask @VesnaT. Linear projection report used to fail on Os X in a similar call, and she fixed it.
There was a problem hiding this comment.
Can you try now? For me it now works on all visualizations.
There was a problem hiding this comment.
Can somebody (@thocevar?) try this PR on Windows?
81607eb to
c5df407
Compare
|
@janezd Tested it. Works on all visualizations, apart from Classification Tree Viewer, which I reckon is of a different type. It also works on Word Cloud in Text add-on, but not on GeoMap. Networks don't work either. But the rest work like a charm, so it's up to you to decide whether we patch those as well or not. 😄 Still, I'm over the moon with this one! :) |
c5df407 to
d92029f
Compare
|
I fixed tree view. If this is the only one that didn't work, we're done here. As for add-ons, GeoMap does not seem so trivial. Networks should be simple, but if I apply the same fix as for trees, the points and edges are misaligned. |
| FileFormat.graph_writers.items()))) | ||
|
|
||
| def copy_to_clipboard(self): | ||
| ClipboardFormat.write_image(None, self.scene) |
There was a problem hiding this comment.
Might setting OWTreeViewer2D.graph_name = 'scene' above also work?
|
Both are pretty trivial. Just a matter of assigning |
|
I changed the tree widget as suggested. For networks, the problem was that I had an old version of the widget. With the last version, |
|
It appears the latest changes haven't been pushed yet? |
d92029f to
55d31c1
Compare
|
Sorry, I forgot. I pushed them now. |

This should work for all widgets that have
graph_nameattribute (~ the Save Image button).Can somebody check it on Linux and Windows? Scatter plot and Box plot, for instance.
@VesnaT, you're an expert for Linear Projection - and saving graphs in general. Can you check why it copying doesn't work for Linear Projection and Distributions?