Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Unicode in TextInput not showing

    QML and Qt Quick
    2
    2
    102
    Loading More Posts
    • 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.
    • T
      t0m.n last edited by t0m.n

      Hi!
      Running the following code, the Unicode char \u0003 only shows in the Text but not in the TextInput. Using a TextField instead of a TextInput also doesn't work.
      Any hints on what I'm missing here?

      This is Qt 5.12.5 on a raspberry Pi3.

      Thanks!

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtQuick.Layouts 1.12
      
      Window {
          visible: true
          width: 640
          height: 480
      
          FontLoader { id: testfont; source: "qrc:/testfont.otf" }
      
          RowLayout {
              anchors.fill: parent
      
              TextInput {
                  font.family: testfont.name
                  font.pixelSize: 36
                  color: "black"
                  text: "\u0003" + "Test"
              }
      
              Text {
                  font.family: testfont.name
                  font.pixelSize: 36
                  color: "black"
                  text: "\u0003" + "Test"
              }
          }
      }
      
      1 Reply Last reply Reply Quote 0
      • Markkyboy
        Markkyboy last edited by Markkyboy

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • First post
          Last post