From 76dd49933b94061ac7d71cef20447f4a43086fd5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 8 Feb 2014 19:04:24 +0000 Subject: Fix embedding several Qt UIs in Gtk (apply #961). git-svn-id: http://svn.drobilla.net/lad/trunk/suil@5335 a436a847-0d15-0410-975c-d299462d15a1 --- NEWS | 6 ++++++ src/qt4_in_gtk2.cpp | 10 +++++++--- wscript | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 0e72fbb..571b075 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ +suil 0.8.1 unstable; + + * Fix embedding several Qt UIs in Gtk + + -- David Robillard Sat, 08 Feb 2014 13:44:47 -0500 + suil 0.8.0 stable; * Add suil_instance_get_handle (patch from Rui Nuno Capela) diff --git a/src/qt4_in_gtk2.cpp b/src/qt4_in_gtk2.cpp index 4bd61a2..e958ce6 100644 --- a/src/qt4_in_gtk2.cpp +++ b/src/qt4_in_gtk2.cpp @@ -59,7 +59,6 @@ suil_qt_wrapper_finalize(GObject* gobject) delete self->qembed; self->qembed = NULL; - delete self->app; self->app = NULL; self->wrapper->impl = NULL; @@ -144,8 +143,13 @@ suil_wrapper_new(SuilHost* host, SuilQtWrapper* const wrap = SUIL_QT_WRAPPER( g_object_new(SUIL_TYPE_QT_WRAPPER, NULL)); - static int argc = 0; - wrap->app = new QApplication(argc, NULL, true); + if (qApp) { + wrap->app = qApp; + } else { + static int argc = 0; + wrap->app = new QApplication(argc, NULL, true); + } + wrap->wrapper = NULL; wrapper->impl = wrap; diff --git a/wscript b/wscript index ca5a3fd..c1772e1 100644 --- a/wscript +++ b/wscript @@ -9,7 +9,7 @@ import waflib.extras.autowaf as autowaf # major increment <=> incompatible changes # minor increment <=> compatible changes (additions) # micro increment <=> no interface changes -SUIL_VERSION = '0.8.0' +SUIL_VERSION = '0.8.1' SUIL_MAJOR_VERSION = '0' # Mandatory waf variables -- cgit v1.2.1