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. How to paint unicode surrogate pairs using QPainter?
Forum Updated to NodeBB v4.3 + New Features

How to paint unicode surrogate pairs using QPainter?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.5k 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.
  • B Offline
    B Offline
    BobWu
    wrote on last edited by
    #1

    If a unicode character with code values above 65535, it will be stored using surrogate pairs, I store it in an QString object, and draw it with QPainter, but nothing will appear, is this a bug? or QPainter's drawText just doesn't support characters above 65535?
    I have set a correct font, the same font in other text editors / word processers can display this character.
    Here is a unicode character for test: "http://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint=22489":http://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint=22489

    1 Reply Last reply
    0
    • B Offline
      B Offline
      BobWu
      wrote on last edited by
      #2

      I tested this problem with a QTextEdit control, QTextEdit have the same problem - it can't display the complex Chinese character.

      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