Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt Academy Launch in California!

    What happened to "Qt:TextWordBreak"?

    General and Desktop
    2
    3
    1364
    Loading More Posts
    • 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.
    • R
      ronM71 last edited by

      It's in the documentation, but codewise, seems like it doesn't exist.

      I am trying to use "MyLabel->fontMetrics().size" to find out the size of a certain text in a label. the label is multi-line with word wrapping. I'd like to find out the size (mainly height) of the outcome text in the current font.

      1 Reply Last reply Reply Quote 0
      • G
        giesbert last edited by

        Hi ronM71,

        it works in general, but with QFontMetrics::size(), it has no bounding rect...
        Try out QFontMetrics::boundingRect...

        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 Reply Quote 0
        • R
          ronM71 last edited by

          Thanks, that did the job along with "Qt::TextWordWrap"

          1 Reply Last reply Reply Quote 0
          • First post
            Last post