Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-115178

Qt::mightBeRichText() incorrect documentation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.2.0
    • GUI: Text handling
    • None

    Description

      Docs:

      /*!
          Returns \c true if the string \a text is likely to be rich text;
          otherwise returns \c false.
      
          This function uses a fast and therefore simple heuristic. It
          mainly checks whether there is something that looks like a tag
          before the first line break. Although the result may be correct
          for common cases, there is no guarantee.
      
          This function is defined in the \c <QTextDocument> header file.
      */
      

      > checks whether there is something that looks like a tag before the first line break.

      it only considers the first entry that looks like HTML tag. The following code won't render the image, because it was auto detected to not be a styled text. Only the <test> is considered by the algorithm in Qt::mightBeRichText

          Text {
              id: myText
              font.pointSize: 32
              text: "hello <test> <img src=\"latvia-flag-small.png\" align=\"bottom\"> world"
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            paeglis Gatis Paeglis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes