linux下激活窗口 qt_在Linux上通过插件将Qt窗口嵌入到Firefox中

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

So I created a 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
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值