Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. How to get HTML code from selected text from Right Click Menu (Context Menu)?

How to get HTML code from selected text from Right Click Menu (Context Menu)?

Scheduled Pinned Locked Moved Qt WebKit
8 Posts 4 Posters 5.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zither
    wrote on last edited by
    #1

    How can I get data from selected text from Right Click Menu (Context Menu)?

    How can I access that part of web page?

    Thanks

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sfilippidis
      wrote on last edited by
      #2

      Could you be a little more descriptive on your question? :-)

      https://www.filippidis.name/

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        zither
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • L Offline
          L Offline
          loladiro
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jim_kaiser
            wrote on last edited by
            #5

            @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!

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              zither
              wrote on last edited by
              #6

              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

              Thanks

              1 Reply Last reply
              0
              • L Offline
                L Offline
                loladiro
                wrote on last edited by
                #7

                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.

                1 Reply Last reply
                0
                • Z Offline
                  Z Offline
                  zither
                  wrote on last edited by
                  #8

                  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

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved