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. QTextBrowser display special char issue
Forum Updated to NodeBB v4.3 + New Features

QTextBrowser display special char issue

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 347 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.
  • Cobra91151C Offline
    Cobra91151C Offline
    Cobra91151
    wrote on last edited by Cobra91151
    #1

    Hi! I want to replace - (dashes) with • (bullets) in the QTextBrowser text.

    ui->textBrowser->setText(QString("-ABCD").replace("-", "\0x2022"));
    

    It displays text without any special character. How to fix it? Thanks.

    1 Reply Last reply
    0
    • Cobra91151C Offline
      Cobra91151C Offline
      Cobra91151
      wrote on last edited by Cobra91151
      #2

      I have fixed it by replacing "\0x2022" to "\u2022" with QStringLiteral macro.

      Code:

      ui->textBrowser->setText(QString("-ABCD").replace("-", QStringLiteral("\u2022")));
      

      Now all works well.

      1 Reply Last reply
      2

      • Login

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