How to get HTML code from selected text from Right Click Menu (Context Menu)?
-
Could you be a little more descriptive on your question? :-)
-
In QWebView, ContextMenuEvent, how do I get selected text from QWebView via Rt Click
e.g, when we select "http://www.google.com" on QWebView contents, Rt Click on them -> Menu Appears -> "Chang with my Home Page" Click -> "http://www.google.com" on QWebView change to my home page address.
The interchange may be the other text or other words..It like when we select URL address on browser, context Menu add option of "Open this in new Tab" although it's not a hyperlink...
Thanks -
I'm not gonna do it for you, but have a look at "this":http://doc.qt.nokia.com/4.7/qwebpage.html#selectedText-prop and "this":http://doc.qt.nokia.com/4.7/qwebpage.html#triggerAction
-
The problem really is that selected text can span more than one element (or just parts of elements). WebKit is not MS Word. It is not that simple. You can play with WebAction and isEditable, but that's more of a dirty hack than anything else. Maybe you can tell us more about the use case and we can guide you to a more appropriate solution.
-
I'm trying to make a browser similar to other browser.
But like not other browser, it can convert to some specific Unicode words replace on incoming web page if loaded page has predefined such unicode character. I post previously for such answer "How to get & change HTML data":http://developer.qt.nokia.com/forums/viewthread/6895/In firefox, similar function plugin & work well. It use javascript. I try to load that javascript funtion to QWebFrame but no change. When I convert all of HTML data from QWebView, web page like "Facebook":http://www.facebook.com, "Gtalk built-in with Gmail":http://mail.google.com doesn't work because they load dynamically...
So, I decided to convert the selected words upon Rt click & convert on request & show the converted words on QWebView in place of previously selected words...
That's all what I want. Sorry for my English...Thanks