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. Simple webkit problem
Forum Updated to NodeBB v4.3 + New Features

Simple webkit problem

Scheduled Pinned Locked Moved Qt WebKit
2 Posts 1 Posters 1.6k Views 1 Watching
  • 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.
  • 2 Offline
    2 Offline
    2beers
    wrote on last edited by
    #1

    SO i have the following code:
    @ frame->setHtml("<html><body><p>First Paragraph</p><p>Second Paragraph</p></body></html>");
    QWebElement doc = frame->documentElement();
    QWebElement body = doc.firstChild();
    QWebElement firstParagraph = body.firstChild();
    qDebug() << "text="+firstParagraph.toPlainText();@

    It seems that it returns an empty string. Am I doing something wrong?

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

      I just realized what's the problem. it seems that if no <head> tag is created webkit creates one automatically.

      Not sure if this is an error or not. If it's not then there is a documentation error on this http://doc.qt.nokia.com/4.7/qwebelement.html from where I get the example.

      Hope this helps.

      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