comparison libgui/graphics/ObjectProxy.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 fe0e34be5576
children 3cc0734283dc
comparison
equal deleted inserted replaced
19714:890ff06d84ce 19715:35bca657d74d
21 */ 21 */
22 22
23 #ifdef HAVE_CONFIG_H 23 #ifdef HAVE_CONFIG_H
24 #include <config.h> 24 #include <config.h>
25 #endif 25 #endif
26
27 #include <QString>
26 28
27 #include "oct-mutex.h" 29 #include "oct-mutex.h"
28 30
29 #include "Object.h" 31 #include "Object.h"
30 #include "ObjectProxy.h" 32 #include "ObjectProxy.h"
48 m_object, SLOT (slotUpdate (int))); 50 m_object, SLOT (slotUpdate (int)));
49 disconnect (this, SIGNAL (sendFinalize (void)), 51 disconnect (this, SIGNAL (sendFinalize (void)),
50 m_object, SLOT (slotFinalize (void))); 52 m_object, SLOT (slotFinalize (void)));
51 disconnect (this, SIGNAL (sendRedraw (void)), 53 disconnect (this, SIGNAL (sendRedraw (void)),
52 m_object, SLOT (slotRedraw (void))); 54 m_object, SLOT (slotRedraw (void)));
55 disconnect (this, SIGNAL (sendPrint (const QString&, const QString&)),
56 m_object, SLOT (slotPrint (const QString&, const QString&)));
53 } 57 }
54 58
55 m_object = obj; 59 m_object = obj;
56 60
57 if (m_object) 61 if (m_object)
60 m_object, SLOT (slotUpdate (int))); 64 m_object, SLOT (slotUpdate (int)));
61 connect (this, SIGNAL (sendFinalize (void)), 65 connect (this, SIGNAL (sendFinalize (void)),
62 m_object, SLOT (slotFinalize (void))); 66 m_object, SLOT (slotFinalize (void)));
63 connect (this, SIGNAL (sendRedraw (void)), 67 connect (this, SIGNAL (sendRedraw (void)),
64 m_object, SLOT (slotRedraw (void))); 68 m_object, SLOT (slotRedraw (void)));
69 connect (this, SIGNAL (sendPrint (const QString&, const QString&)),
70 m_object, SLOT (slotPrint (const QString&, const QString&)));
65 } 71 }
66 } 72 }
67 } 73 }
68 74
69 void ObjectProxy::setObject (Object* obj) 75 void ObjectProxy::setObject (Object* obj)
89 void ObjectProxy::redraw (void) 95 void ObjectProxy::redraw (void)
90 { 96 {
91 emit sendRedraw (); 97 emit sendRedraw ();
92 } 98 }
93 99
100 void ObjectProxy::print (const QString& file_cmd, const QString& term)
101 {
102 emit sendPrint (file_cmd, term);
103 }
104
94 }; 105 };