Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Chracter wrapping in label widget
Forum Updated to NodeBB v4.3 + New Features

Chracter wrapping in label widget

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 3 Posters 5.3k 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.
  • S Offline
    S Offline
    sk.qt
    wrote on last edited by
    #1

    Hi ,
    Here as per given i have done wordwrapping by using wordwrap method.but der is not charwrap method for lablel and some of widgets except textedit.so please anyone give me idea how can fix this one .i have gone through diff options but its yet to get the result..

    Thanks
    sk

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

      QLabel does have "a word wrap property":http://doc.qt.nokia.com/4.6/qlabel.html#wordWrap-prop.

      For anything else you will need to be more specific.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sk.qt
        wrote on last edited by
        #3

        Thanks for reply.yes as per specific,here i need character wrapping not word wrapping .so for that what need to do?

        1 Reply Last reply
        0
        • ? This user is from outside of this forum
          ? This user is from outside of this forum
          Guest
          wrote on last edited by
          #4

          there is no ready api available for character wrapping in a label. whereas QTextEdit supports this feature by wrapping on a fixed column width. Depending on your use case, you can use a disabled QTextEdit styled to look how you want and fake it as a label (of course no pixmaps by default)

          Else you can extend QLabel and build this capability in your custom label

          1 Reply Last reply
          0
          • T Offline
            T Offline
            tzander
            wrote on last edited by
            #5

            To continue on the idea of chetankjain, a QTextEdit holds a QTextDocument and that one can have its wrapping mode set to much more complicated modes than a QLabel. One of them is QTextOption::WrapAnywhere which seems to be what you want.

            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