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. Inline wrapping in QT
Qt 6.11 is out! See what's new in the release blog

Inline wrapping in QT

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.5k 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
    maxg0
    wrote on last edited by
    #1

    Can anyone clarify whether it is possible to wrap around text or a long image inside a QLabel, so that the wrapping is on the same line?

    What I have so far is

    @mLabel = new QLabel("SHOW ME HOW YOU SCROLL PLEASE", this);

    mLabel->resize(170,30);@

    Is there a way of inline wrapping that text?

    Many Thanks for your help

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you try "this":http://qt-project.org/doc/qt-5.0/qtwidgets/qlabel.html#wordWrap-prop ?

      Hope it helps

      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
      • C Offline
        C Offline
        ChrisW67
        wrote on last edited by
        #3

        I do not think the OP wants to wrap the text, they want a side-to-side scroll similar to the maligned HTML marquee element. This can be done with a timer and the paintEvent() of a sub-classed QLabel. Just use your favourite search engine for "QLabel marquee"...

        Whether it should be done is another thing entirely :)

        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