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. Symbols like € œ when given as part of text are displayed differently

Symbols like € œ when given as part of text are displayed differently

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 2.0k 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.
  • K Offline
    K Offline
    kusumk
    wrote on last edited by
    #1

    Hi,
    I have to display € œ as part of the text element. In the qml file the above symbols are shown properly but when i run the program. They are shown differently.

    Please let me know how i can resolve this problem. I have run it on desktop only.

    Regards
    Kusuma

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      welcome to devnet

      This must have to do with the different character sets used. Unfortunately (or maybe luckily), I am displaying only standard sets. But the section you need to focus on should be with "QLocale":http://qt-project.org/doc/qt-5.0/qtcore/qlocale.html

      [edit] Hope this helps somehow. :)

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kusumk
        wrote on last edited by
        #3

        Thanks for the reply.

        Hi this is the qml file i have used ..

        @
        import QtQuick 1.0
        Rectangle {
        width: 360
        height: 360
        Text {
        text: qsTr("Hello World € æ œ")
        anchors.centerIn: parent
        }
        MouseArea {
        anchors.fill: parent
        onClicked: {
        Qt.quit();
        }
        }
        }
        @
        The output window shows diff characters for euro and french symbols. I am running this program in ubuntu 11.10. It must be using standard charsets right? I am not knowing how to link/use QLocale to this piece of code.

        you can find a snapshot of the output here -
        http://www.qtforum.org/article/39544/symbols-like-€-œ-when-given-as-part-of-text-are-displayed-differently.html#post122227

        1 Reply Last reply
        0
        • K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          Sorry, I did not pay attention that it was posted under Qt Quick. I am not of any help here.

          Note: In order to make your code more readable you should use" code tagging/wrappings":http://qt-project.org/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01
          I have introduced those for you in your last post.

          Vote the answer(s) that helped you to solve your issue(s)

          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