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. Smooth circular scrolling text in QLabel
Forum Updated to NodeBB v4.3 + New Features

Smooth circular scrolling text in QLabel

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 2.6k 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.
  • L Offline
    L Offline
    luca
    wrote on last edited by
    #1

    Hi all,
    I need to scroll the text in a QLabel as in the following example:
    @
    hello world
    ello world h
    llo world he
    lo world hel
    o world hell
    ...
    ...
    @

    I know how to obtain that by manipulating string but I 'd like to get a smooth scrolling (pixel by pixel) .

    Is it possible?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tilsitt
      wrote on last edited by
      #2

      Hi,

      I think that could be possible by re-implementing paintEvent().

      1 Reply Last reply
      0
      • L Offline
        L Offline
        luca
        wrote on last edited by
        #3

        Can you give me some examples?

        1 Reply Last reply
        0
        • E Offline
          E Offline
          eliseev
          wrote on last edited by
          #4

          Subclass QLabel, rewrite paintEvent()...

          Here's Qt's implementation: https://qt.gitorious.org/qt/qt/blobs/4.8/src/gui/widgets/qlabel.cpp#line1078 Actually you're interested only in text label, then look at lines 1098-1146. Then figure out how'd you draw text the way you want.

          Not an easy way, really.

          I'd first try just working on text (timer at 30fps that would modify Label's text) and see how well it animates. This is simple.

          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