Get text out of innerHTML displayed in a QWebEngineView



  • 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.



  • Try:

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


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

    Try:

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

    alt text


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.