Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Get text out of innerHTML displayed in a QWebEngineView
Forum Update on Monday, May 27th 2025

Get text out of innerHTML displayed in a QWebEngineView

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 1.3k 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.
  • B Offline
    B Offline
    bask185
    wrote on last edited by
    #1

    I have spend many many hours today on reading qt docs trying to get the active text out of a html which is displayed in a QWebEngineView.

    I have had partial succes with the function: ''selectedText()". The problem was that I have to select the content I need with the mouse. And this simply does not work for my target-device.

    I have been reading this Qdoc but I am not seeing any function I can use. If I would have a 'selectAllText' function I would be done.

    How do I get all text or part of texts out of the active html?

    To be clear I am using

    QWebEngineView *engine;
    

    and it loads an html

    engine->load(QUrl("qrc:/resources/img/frmSSPeditor.html"));
    engine->show();
    

    alt text
    I need to get the intel out of the right column. It holds commands with parameters for a machine

    If I just have a way with which I can get all text in a QString somehow, I'd would a very very happy man.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bask185
      wrote on last edited by
      #3

      @mpergand said in Get text out of innerHTML displayed in a QWebEngineView:

      Try:

      engine->page()->triggerAction(QWebEnginePage::SelectAll);
      

      alt text

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mpergand
        wrote on last edited by
        #2

        Try:

        engine->page()->triggerAction(QWebEnginePage::SelectAll);
        
        1 Reply Last reply
        1
        • B Offline
          B Offline
          bask185
          wrote on last edited by
          #3

          @mpergand said in Get text out of innerHTML displayed in a QWebEngineView:

          Try:

          engine->page()->triggerAction(QWebEnginePage::SelectAll);
          

          alt text

          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