Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. TextEdit and Markdown blank lines.
Forum Updated to NodeBB v4.3 + New Features

TextEdit and Markdown blank lines.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 502 Views
  • 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.
  • EndrII 0E Offline
    EndrII 0E Offline
    EndrII 0
    wrote on last edited by
    #1

    Hi,
    TextEdit not showing empty lines in markdown format.

        TextEdit {
                        id: sourceText
                        font.bold: false
                        font.pixelSize: sourceTextPixelSize
                        horizontalAlignment: Text.AlignLeft
                        verticalAlignment: Text.AlignVCenter
                        text: "1 line \n\n \n\n \n\n \n\n" +
                              "2 line \n\n" +
                              "  " +
                              "3 line \n"
                
                        color: fontColor
                        readOnly: false
                        selectByMouse: true
                        textFormat: TextEdit.MarkdownText
                
                        wrapMode: Text.WordWrap
                
                        layer.enabled: true
                
                        anchors.fill: parent
                
                    }
    

    Based on the value of the text property, I should get several blank lines between lines 1 line and 2 line, but instead of that I get the text already in the next line.

    0f701aa6-410e-44ed-9be4-01513bc1767f-изображение.png

    How to fix it?

    1 Reply Last reply
    0
    • GrecKoG Offline
      GrecKoG Offline
      GrecKo
      Qt Champions 2018
      wrote on last edited by
      #2

      @EndrII-0 said in TextEdit and Markdown blank lines.:

      Based on the value of the text property, I should get several blank lines between lines 1 line and 2 line, but instead of that I get the text already in the next line.

      No, markdown syntax doesn't work like that.
      Qt use the CommonMark format, if you want to add arbitrary new lines you can use an inline HTML tag: <br/>

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved