Mercurial > octave-nkf
comparison libgui/graphics/Canvas.cc @ 19715:35bca657d74d
printing for Qt plot widget (bug #42537)
* Backend.h, Backend.cc (Backend::print_figure): New function.
* Canvas.h, Canvas.cc (Canvas::print): New function.
* Figure.h, Figure.cc (Figure:print): New function.
* Object.h, Object.cc (Object::slotPrint, Object::print):
New functions.
* ObjectProxy.h, ObjectProxy.cc (ObjectProxy::print): New function.
(ObjectProxy::sendPrint): New signal.
(ObjectProxy::init): Connect sendPrint signal to slotPrint slot of
current object.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 08 Feb 2015 16:25:06 -0500 |
parents | dfea01b3425f |
children | ed1bafbb87ee |
comparison
equal
deleted
inserted
replaced
19714:890ff06d84ce | 19715:35bca657d74d |
---|---|
36 #include "Canvas.h" | 36 #include "Canvas.h" |
37 #include "ContextMenu.h" | 37 #include "ContextMenu.h" |
38 #include "GLCanvas.h" | 38 #include "GLCanvas.h" |
39 #include "QtHandlesUtils.h" | 39 #include "QtHandlesUtils.h" |
40 | 40 |
41 #include "gl2ps-renderer.h" | |
42 | |
41 namespace QtHandles | 43 namespace QtHandles |
42 { | 44 { |
43 | 45 |
44 void Canvas::redraw (bool sync) | 46 void Canvas::redraw (bool sync) |
45 { | 47 { |
76 | 78 |
77 default: | 79 default: |
78 w->setCursor (origCursor); | 80 w->setCursor (origCursor); |
79 break; | 81 break; |
80 } | 82 } |
83 } | |
84 } | |
85 | |
86 void Canvas::print (const QString& file_cmd, const QString& term) | |
87 { | |
88 graphics_object obj = gh_manager::get_object (m_handle); | |
89 | |
90 if (obj.valid_object ()) | |
91 { | |
92 graphics_object figObj (obj.get_ancestor ("figure")); | |
93 | |
94 gl2ps_print (figObj, file_cmd.toStdString (), term.toStdString ()); | |
81 } | 95 } |
82 } | 96 } |
83 | 97 |
84 void Canvas::updateCurrentPoint(const graphics_object& fig, | 98 void Canvas::updateCurrentPoint(const graphics_object& fig, |
85 const graphics_object& obj, QMouseEvent* event) | 99 const graphics_object& obj, QMouseEvent* event) |