Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to get HTML code from selected text from Right Click Menu (Context Menu)?
How can I get data from selected text from Right Click Menu (Context Menu)?
How can I access that part of web page?
sfilippidis last edited by
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...
loladiro last edited by
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
jim_kaiser last edited by
@loladiro: hehehe... :)
@zither: Come on man! As loladiro has posted above, just spend 2 mins with the documentation and problem solved!
I sometimes wonder if people are aware of the existence of Qt-Assistant!
It's OK, but one important is I want to change that selected text.. without touching another contents of web page..
I try to cut, but not work ...
How can I do that? via WebPage Action? Plz point to me
loladiro last edited by
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/
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...