Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Markdown codeblock colours in QTextEdit
Qt 6.11 is out! See what's new in the release blog

Markdown codeblock colours in QTextEdit

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 743 Views 1 Watching
  • 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
    Caeden
    wrote on last edited by
    #1

    When I am rendering markdown in a QTextEdit using the QTextEdit.setMarkdown(markdown) it shows the code in the markdown formatting way, however it is colourless. How can I make it render colours as well?

    Reproducible code: create a QTextEdit and set the markdown of

    import unittest
    
    class LevelOneTest(unittest.TestCase):
        pass
    

    I can see in the preview [^] there is colour, which is what I want, however in the example below there is no md colour.

    e23434a6-7fe7-496e-91be-b095b9b09751-image.png

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Caeden
      wrote on last edited by
      #5

      I used a QSyntaxHighler

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        You should add which version of Qt you are using.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        C 1 Reply Last reply
        0
        • C Offline
          C Offline
          Caeden
          wrote on last edited by
          #3
          This post is deleted!
          1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            You should add which version of Qt you are using.

            C Offline
            C Offline
            Caeden
            wrote on last edited by
            #4

            @SGaist Version 5.15.7

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Caeden
              wrote on last edited by
              #5

              I used a QSyntaxHighler

              1 Reply Last reply
              0

              • Login

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