开发者

Embed Qt window into firefox, via plugin, on Linux

So this is a trivial example of what I'm trying to accomplish:

Using QX11EmbedContainer, and QX11EmbedWidget, I can create two separate apps that embed the widget from one into the window of the other (container <- widget). I would like to do the same in Firefox, and embed the widget into a plugin.

So I created 开发者_如何学Pythona basic plugin that just contains the QX11EmbedContainer (starting from the 'trivial' example of qtbrowserplugin), and just for testing purposes, another generic widget.

The result is that the generic widget shows inside the plugin just fine, but the container widget 'pops' out to a separate window.

This occurs under Firefox, Chrome, and even Konqueror.

So the question is - Is it possible to embed external Qt widgets into a plugin?


The answer is yes, but the Qt code is buggy, which is why I'm not including it- you wouldn't want it anyway. Managed (with the help of Trolltech engineers) to insert a vanilla QTextEdit widget. Upon attempting to enter text, the plugin would crash, often taking Firefox with it. So clearly, embedding Qt objects directly into a plugin is a no-go.

I also tried launching it separately with mozplugger, but that had it's own issues - mainly focus was not tracked correctly, and would often be lost, requiring you to restart the plugin to get it back.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜