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. Draw a Line in a Text Label
Forum Updated to NodeBB v4.3 + New Features

Draw a Line in a Text Label

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 4.4k 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.
  • J Offline
    J Offline
    justdad
    wrote on last edited by
    #1

    I am using richtext for items in a label and I would like to draw a continuous line. How do I do this?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rokemoon
      wrote on last edited by
      #2

      If you want like this -test- then
      @ QLabel *lbl = new QLabel("<s>test</s>", this);@

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rokemoon
        wrote on last edited by
        #3

        And another popular cases:
        @
        <b>bold text</b>
        <i>highlighting text in italics</i>
        <u>underlined text</u>
        <s>strikethrough text</s>
        <small>small font</small>
        <big>large font</big>
        @

        1 Reply Last reply
        0
        • A Offline
          A Offline
          alexisdm
          wrote on last edited by
          #4

          If you just want a horizontal line: "<hr/>"

          1 Reply Last reply
          0
          • G Offline
            G Offline
            giesbert
            wrote on last edited by
            #5

            You could use the "text frame feature of a QTextDocument":http://doc.qt.nokia.com/4.7/richtext-cursor.html#frames which can have a border and check, how it looks like in the RTF format.

            Nokia Certified Qt Specialist.
            Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

            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