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

Add toPlainText method to QQuickText

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 5.14.1
    • None
    • All

    Description

      Provide a way to check the plain text characters of qquicktext, excluding characters that are markup. Ideally exposing something like QTextDocument::toPlainText. Our use case is to truncate certain text fields based on a max character count.

      A not so nice workaround is to use a parallel QTextDocument instance, but this would only yield correct results in case of RichText, not in case of StyledText:

      doc = QTextDocument()
      doc.setHtml(markupText)
      text = doc.toPlainText()
      

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            dkdai dkdai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes