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. QML: superscript/subscript text
Forum Updated to NodeBB v4.3 + New Features

QML: superscript/subscript text

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 3.1k 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.
  • M Offline
    M Offline
    MrHeaven
    wrote on 19 May 2014, 13:53 last edited by
    #1

    The problem is that QML totally ignores <sub> and <sup> html tags, that are actually mentioned in official "Supported HTML Subset":http://qt-project.org/doc/qt-4.7/richtext-html-subset.html#id-ed613049-e204-44d2-816d-74bb4b42ea92.
    So the following code will display regular "xy":

    @Text {
    text: "x<sup>y</sup>"
    }@

    Is there any another possible way to display subscript/superscript text?

    1 Reply Last reply
    0
    • J Online
      J Online
      jeremy_k
      wrote on 19 May 2014, 19:41 last edited by
      #2

      Using 5.2.1 on Linux, <sup> and <sub> change the text size if textFormat is Text.RichText, but they're not elevated or depressed as I would have expected.

      https://bugreports.qt-project.org/browse/QTBUG-24621 and https://bugreports.qt-project.org/browse/QTBUG-32948 acknowledge the problem.

      One workaround is to draw super- or subscripted text as a child or sibling Text with a smaller font.pixelSize and anchored to the normal text's top or bottom.

      Asking a question about code? http://eel.is/iso-c++/testcase/

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MrHeaven
        wrote on 19 May 2014, 19:54 last edited by
        #3

        Thanks for reply.
        According to given reports, bug is years old... Very sad that developers turn a blind eye to this kind of things.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 19 May 2014, 22:01 last edited by
          #4

          Hi,

          They don't but Qt is big and the developer teams have only so many members. However, you can help getting the bug fixed by voting for it and make it known that it's still an issue in the latest version.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          1/4

          19 May 2014, 13:53

          • Login

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