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. QTextEdit::toHtml() does not return the html title tag
Forum Updated to NodeBB v4.3 + New Features

QTextEdit::toHtml() does not return the html title tag

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

    I have a html code in a textEdit in which I am inserting a image with a title. When I call toHtml() it does not show the title, only the img src. Anyone have any ideas as to why this is happening?

    @
    QTextEdit *sth = new QTextEdit();
    sth->setAcceptRichText(true);
    sth->insertHtml("<img title = "wtv" src = "url to image" >");
    qDebug() << sth->toHtml(); // this shows only <img src = "url to image" >
    @

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

      The simple answer is that QTextDocument is not a html editor.
      The html it supports is only sufficient to display its internal data similarly enough to be useful.

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

        but as long as it renders the html title tag shouldn't it be returned when using toHtml? I mean what else would be the point to display the title then?

        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