[Qt-interest] anyone gotten QWebPage::createPlugin() to work?
Paul Miller
paul at fxtech.com
Fri May 8 15:52:03 CEST 2009
Tony Rietwyk wrote:
> Paul wrote:
>
>> I'm trying to embed a custom widget into a web page and using
>> the HTML
>> <object> element an overridden createPlugin() method. The method is
>> getting called and my widget is getting constructed, but it
>> is not being
>> displayed in the resulting page.
>>
>> The documentation is pretty sparse in this area and the few examples
>> I've found don't really got into more detail.
>>
>> Is there some magic step I'm missing?
>
> Hi Paul,
>
> I use a QWebPluginFactory, and override the create method which just creates
> and returns the appropriate widget depending on the parameters.
>
> It works well in 4.5. In 4.4, there were repaint issues when scrolling in
> the web view.
>
> My only problem now is how to get the sizeHints from the widget to override
> the <object> tag size!
Thanks Tony. Actually the other method DOES appear to work. But there
are two problems:
1. Any HTML *after* my object element doesn't appear. For example, with
this HTML:
<H1>test</H1>
<object type='application/x-qt-plugin' classid='test' width='100'
height='30'/>
</h2>test2</h2>
I see "test" and the custom widget, but not "test2".
2. When sent to a PrintPreviewDialog, the custom widget is not displayed
in the preview, nor is it actually printed.
I'm wondering if I need to do something special to the custom widgets to
get them to print.
Any ideas?
--
Paul Miller | paul at fxtech.com | www.fxtech.com | Got Tivo?
More information about the Qt-interest-old
mailing list