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. Auto format Markdown text in QML textarea/text edit
Forum Updated to NodeBB v4.3 + New Features

Auto format Markdown text in QML textarea/text edit

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 305 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 1 Oct 2021, 02:45 last edited by cebuger 10 Jan 2021, 02:46
    #1

    I am trying to implement the same feature as that of Slack where in a user can type a markdown text such as (asterisk asterisk) hello (asterisk asterisk) and it automatically converts to markdown version in the same TextArea.

    I read the documentation and tested it and it doesnt do auto detect and replace,
    so i was planning to listen to onTextChanged event and just reset the text but unfortunately, the Markdown format doesnt reflect.

    if I type (asterisk)(asteriks) hello (asterisk) (asterisk), and reset it back to textArea.text = text

    TextArea {
              id: mainText
              anchors.fill : parent
              textFormat: TextEdit.MarkdownText
         
               onTextChanged: {
                        mainText.text = text;
                }
    

    Is there a way to do this in QML? im using 5.15. If not any suggestion on how to do this?

    1 Reply Last reply
    1

    1/1

    1 Oct 2021, 02:45

    • Login

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