PDA

View Full Version : Embed Plugin Widget into WebView



hvitual
28th June 2010, 14:29
I'm coding a application in which I embeded a plugin widget into webview.

Figure:
http://lh6.ggpht.com/_cvJnL2xqj_w/TCiiF9LW-JI/AAAAAAAAAlU/N3-iGTiYcbk/pluginWidget.png

I reimplemented QWebPluginFactory::create to create QPushButton plugin.

Qt Code:


QObject *CyWebPluginFactory::create(const QString &mimeType, const QUrl &url, const QStringList &argumentNames, const QStringList &argumentValues) const {
Q_UNUSED(url);
Q_UNUSED(argumentNames);
Q_UNUSED(argumentValues);
if (mimeType != "pushbutton")
return 0;

return new QPushButton(QString("Plugin Widget"));


Then, I write a code HTML. It contains <Object> tag to embed QPusbButton into web page.
Html Code:


....
<style type="text/css">
.divWidget {
width: 300px;
height: 400px;
background-color: blue;
position: absolute;
z-index: 1000000;
}

.pluginWidget {
width: 600px;
height: 300px;
background-color: red;
position: absolute;
z-index:-1;
}
</style>
....
<div class="divWidget">DIV Widget</div>
<div class="pluginWidget"><object type="pushbutton" data="" width="100" height="50"></object></div>
....


I write two div block.
- One's blue which contain "DIV Widget" string.
- One's red which contain plugin widget.

I assigns z-index attribute of blue block with a big number because I want it's on top (always on top).

But I'snt work.
Plugin Widget is always on top.

I need help to solve this problem.
Thanks.

mus001
29th June 2010, 03:09
I have same problem....
------------------------------------------------

hvitual
3rd July 2010, 02:53
Thanks ......................
-------------------------------------------------

waper
30th March 2012, 10:25
I have the same problem on both Qt 4.7.4 and it seems not fixed in Qt4.8.0.
So I made a simple work-around to repaint the below image above the plugin.

If you guys are interested can contact me.

anatsarig
21st July 2013, 16:07
I have the same problem on both Qt 4.7.4 and it seems not fixed in Qt4.8.0.
So I made a simple work-around to repaint the below image above the plugin.

If you guys are interested can contact me.

Please do put your workaround.
Thanks a lot