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. QML framework Bug found , text Area and Markdown, garbage remain after emptying content
Forum Updated to NodeBB v4.3 + New Features

QML framework Bug found , text Area and Markdown, garbage remain after emptying content

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 257 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.
  • C Offline
    C Offline
    cebuger
    wrote on last edited by cebuger
    #1

    using an ordinary text area in QML, setting it up with a markup formatting. using the header "#" markup.

    after deleting all the content using backspace, it will appear that the text area is empty.
    after typing a single letter, the text will appear as usual but, the actual content of the TextArea.txt will contant the "#" deleted previously.

    here is the QML code

    import QtQuick 2.15
    import QtQuick.Window 2.15
    import QtQuick.Controls 2.12
    
    Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
        id: mainWindow
        TextArea {
                id: mainText
                    anchors.fill : parent
                    textFormat: TextEdit.MarkdownText
                    text: "# Header"
                    Keys.onPressed: {
                    if(event.key === Qt.Key_B && (event.modifiers & Qt.ControlModifier )){
    
                        // for debugging
                        console.debug("main text is ", mainText.text);
                    }
                }
        }
    }
    
    

    Steps to reproduce

    1. Here I have a TextArea with Markdown formatting, after running this application, it will display the correct header.
    2. Now, delete the content of the TextArea using backspace until all text is gone.
    3. once confirmed, press Ctrl + B, it will print/dump the content of the text area, it is empty and length is 0.
    4. now type a single character in the text area, it will appear as expected in the running UI... BUT..
    5. when pressing Ctrl+B again to dump the content of mainText.text, the text Area will have the "#" plus the character typed in #4. Ex: "# s" assuming "s" was the character typed.

    my environment
    QT Creator 5.0.1 based on QT 5.15.2 (VS2019, 64 bit)

    I was trying to report this bug in QT bug report tool but I dont know what categories this should be placed.

    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