PDA

View Full Version : QT 4.2.3 Using GTK Widgets inside QT App



chuckshaw
15th April 2007, 04:28
Hey guys,

I'm working on embedding Gecko in a QT app using GtkMozEmbed. With Qt 4.2 now using the glib event loop I want to integrate Gtk based widgets with my qt apps, in the same process. Has anyone had good success with that? Or do i still need to use QX11EmbedContainer? I have a simple app i found googling that uses both QT and Gtk in the same app. Showing a qt window with a button, that when clicked will launch a gtk window with a button, that goes back the other direction.

A simple question would be has anyone been able to do something like display a window with two buttons, one using QT and one using Gtk side by side in the initial qt window? Is there any particular technique to say, building a class extending QWidget that the gui components within are all built using Gtk, that would allow me to instantiate it in any other qt app and display it?

Thanks,
Chuck

jamadagni
19th April 2007, 03:40
I don't have an answer to your exact question but I do know that it is possible to draw GTK widgets using Qt -- that involves writing a GTK style which just calls the Qt widgets -- similarly perhaps it would be possible to have a Qt style which uses GTK widgets.

But I don't think that in a Qt application you can draw a GTK widget at all (directly I mean). The reason being that I don't think a GTK widget will submit to the control of a QLayout, or that a QLayout has the capability of handling a GTK widget. I do not think that a widget that a QLayout cannot handle can be drawn. But maybe you could directly write an X app which uses both the Qt and GTK widgets but then you would have to take care of layout etc yourself which would be a pain.

Of course, I'm not as knowledgeable as many people around here and my opinion may be wrong. I only answered because I noticed your question was unanswered for two days. I hope this helps at least a bit.