Mercurial > octave
diff libgui/graphics/Object.cc @ 27376:1952e110d346
Allow Qt graphics callbacks to work again (bug #56857)
* Object.h, Object.cc (Object::do_connections): New virtual method. Do
connections that were previously done in qt_graphics_toolkit::create_object
* qt_graphics_toolkit.cc (qt_graphics_toolkit::create_object): Let
Object::do_connections do the signal/slot connections.
* Figure.h, Figure.cc (Figure::do_connection): Overload Object::do_connections
to also make connections on peer Canvas object.
* Panel.h, Panel.cc (Panel::do_connection): Overload Object::do_connections
to also make connections on peer Canvas object.
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Thu, 05 Sep 2019 10:13:39 +0200 |
parents | 50216d7a2f6b |
children | c40be2cf044d |
line wrap: on
line diff
--- a/libgui/graphics/Object.cc Thu Sep 05 17:42:07 2019 -0400 +++ b/libgui/graphics/Object.cc Thu Sep 05 10:13:39 2019 +0200 @@ -215,4 +215,71 @@ return nullptr; } + void + Object::do_connections (const QObject *receiver, const QObject *emitter) + { + if (! emitter) + emitter = this; + + connect (emitter, + SIGNAL (interpreter_event (const octave::fcn_callback&)), + receiver, + SLOT (interpreter_event (const octave::fcn_callback&))); + + connect (emitter, + SIGNAL (interpreter_event (const octave::meth_callback&)), + receiver, + SLOT (interpreter_event (const octave::meth_callback&))); + + connect (emitter, + SIGNAL (interpreter_event (const octave::meth_callback&)), + receiver, + SLOT (interpreter_event (const octave::meth_callback&))); + + connect (emitter, + SIGNAL (gh_callback_event (const graphics_handle&, + const std::string&)), + receiver, + SLOT (gh_callback_event (const graphics_handle&, + const std::string&))); + + connect (emitter, + SIGNAL (gh_callback_event (const graphics_handle&, + const std::string&, + const octave_value&)), + receiver, + SLOT (gh_callback_event (const graphics_handle&, + const std::string&, + const octave_value&))); + + connect (emitter, + SIGNAL (gh_set_event (const graphics_handle&, + const std::string&, + const octave_value&)), + receiver, + SLOT (gh_set_event (const graphics_handle&, + const std::string&, + const octave_value&))); + + connect (emitter, + SIGNAL (gh_set_event (const graphics_handle&, + const std::string&, + const octave_value&, bool)), + receiver, + SLOT (gh_set_event (const graphics_handle&, + const std::string&, + const octave_value&, bool))); + + connect (emitter, + SIGNAL (gh_set_event (const graphics_handle&, + const std::string&, + const octave_value&, + bool, bool)), + receiver, + SLOT (gh_set_event (const graphics_handle&, + const std::string&, + const octave_value&, + bool, bool))); + } + }