I'm coding a application in which I embeded a plugin widget into webview.
Figure:

I reimplemented QWebPluginFactory::create to create QPushButton plugin.
Qt Code:
Q_UNUSED(url);
Q_UNUSED(argumentNames);
Q_UNUSED(argumentValues);
if (mimeType != "pushbutton")
return 0;
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"));
To copy to clipboard, switch view to plain text mode
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>
....
....
<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>
....
To copy to clipboard, switch view to plain text mode
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.
Bookmarks