Home > Enterprise >  How to input Unicode characters of which Unicode number exceeds 10000 in QML?
How to input Unicode characters of which Unicode number exceeds 10000 in QML?

Time:09-17

When coding QML, I usually input Unicode words via "\uxxxx". But it doesn't work for the characters of which Unicode number is over 10000, e.g. U 1F300. How to input it via Unicode number?

ToolButton {
    id: toolButton
    text: "\u1F300"
}

CodePudding user response:

You can use the JS function String.fromCodePoint:

ToolButton {
    id: toolButton
    text: String.fromCodePoint(0x1F300)
}
  • Related