> On Tuesday 23 August 2011 23:47:33 Benoît Minisini wrote:
> > > This code I got I think from the webview demo some time ago:
> > > If hTest.Selected Then
> > >
> > > Clipboard.Copy(Webview1.SelectedText)
> > > Print webview1.SelectedText
> > >
> > > End If
> > >
> > > If the webview contains html, then the print webview1.selected text
> > > prints out plain text.
> > >
> > > Is there anyway I can capture the html of the text? into a variable. It
> > > must be around somewhere because if I select the text, due a ctrl
> > > copy, and then paste it into a textarea with the middle mouse button,
> > > then it is pasted as formatted html.
> > >
> > > REgards
> > >
> > > Richard
> >
> > Apparently there is no way in QtWebKit to retrieve the HTML selected
> >
> > text... I will investigate.
> >
> > And please if you can use a mail subject that is related to its contents!
> >
> > Regards,
Hi, Richard.
I have added a WebView.Eval() method in the last revision. That method allows
you to evaluate any JavaScript method in the context of the web page.
That way, I think you may get the selected HTML. But I don't know the DOM API
enough to tell you if there is a method for that.
The following hack may work anyway:
WebSettings[WebSettings.JavascriptCanAccessClipboard] = True
MyWebView.Eval("document.execCommand('Copy', false, null)")
Print Clipboard.Paste("text/html")
But the returned HTML is not pretty...
Regards,
--
Benoît Minisini
------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management
Up to 160% more powerful than alternatives and 25% more efficient.
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user