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. Change colour of link of MarkdownText
Qt 6.11 is out! See what's new in the release blog

Change colour of link of MarkdownText

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlmarkdown
2 Posts 2 Posters 808 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
    ChiefyChief23
    wrote on last edited by ChiefyChief23
    #1

    Hello all,

    Am wondering how to change the colour of the link within a Qml Text when rendered as MarkdownText. The example I have is:

    14ae0c72-1f88-4128-a2c2-f18762760bc7-image.png

    I've tried to set linkColor but nothing seems to change?

    I've tried using all the Qml text objects such as Text, TextArea, TextEdit, etc

    1 Reply Last reply
    0
    • V Offline
      V Offline
      versusvoid
      wrote on last edited by
      #2

      When parsing markdown color of links is set to value from global QPalette.

      You can change it by modifying global QPalette:

          QGuiApplication app(argc, argv);
      
          QPalette palette;
          QColor linkColor(Qt::red);
          palette.setColor(QPalette::Link, linkColor);
          app.setPalette(palette);
      

      but it will affect whole app and may lead to unwanted changes in other places.

      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