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

QML TextEdit doesn't display text at all when MarkdownText format is set and its "text" property is being accessed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7.3, 6.8.0
    • GUI: Text handling
    • None
    • macOS

    Description

      I found a VERY odd bug today. Simply running the following example, the text of the TextEdit will not show up.

      import QtQuick
      import QtQuick.Controls
      
      ApplicationWindow {
          id: root
          width: 400
          height: 400
          visible: true    
          
          TextEdit {
              x: 20
              text: "Hello"
              textFormat: Text.MarkdownText        
              onTextChanged: {
                  console.log(text);
              }
          }
      }
       

      If we remove the "onTextChanged" slot, then it seems to work, oddly enough. If we change  "MarkdownText" to "PlainText" it also works.

      In my own app I get this bug without using "onTextChanged" but I still couldn't reproduce it. Unfortunately, this bug doesn't allow me to use the built-in Markdown text in my delegate for a new app I'm working on.

      If I manage to reproduce the case where the bug occurs without onTextChanged I'll report it in the comments.

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            rubymamis Ruby Mamistvalove
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes