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. [Solved] Superscript/Subscript a sub-string of text in QLabel?
Forum Updated to NodeBB v4.3 + New Features

[Solved] Superscript/Subscript a sub-string of text in QLabel?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 11.9k 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.
  • C Offline
    C Offline
    CAD_coding
    wrote on 26 Mar 2013, 05:17 last edited by
    #1

    Hi,
    I have a QLabel with some text.
    I want to superscript some part of the text.
    How do I do that?
    Also what if I want to subscript?
    Thank You.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Sam
      wrote on 26 Mar 2013, 05:25 last edited by
      #2

      For a QLabel you can set the text as

      @label->setText("A<sub>1</sub><sup>2</sup>");@

      1 Reply Last reply
      0
      • C Offline
        C Offline
        CAD_coding
        wrote on 27 Mar 2013, 05:18 last edited by
        #3

        @Sam Thank You.
        That Worked!

        1 Reply Last reply
        0

        1/3

        26 Mar 2013, 05:17

        • Login

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