c++ - How to use Qt widgets in a plugin for a Gtkmm based application? -
i develop gtkmm based application, can extended through plugin mecanism. each plugin must define show() method
void myextension::show() { // here code of extension }
i trying develop plugin uses qt widgets. newbie in qt, tried following simple code:
void myextension::show() { int argc = 1; char argv1[] = "myapp"; char* argv[] = { argv1, null }; qapplication app(argc, argv); qmessagebox::question(null, "title", "what?", qmessagebox::yes|qmessagebox::no); app.exec(); app.exit(); }
this source code builds perfectly, first execution of plugin ok (the dialog box shown), after first execution of plugin, qapplication seems perturb gtk event loop. messages ones:
gtk-critical **: ia__gtk_container_add: assertion `gtk_is_container (container)' failed gtk-critical **: ia__gtk_widget_realize: assertion `gtk_widget_anchored (widget) || gtk_is_invisible (widget)' failed
and application crashes on third or fourth execution of plugin.
any idea develop plugins (=shared lib loaded @ runtime) qt widgets, , plugged gtkmm app? lot.
Comments
Post a Comment