Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 430183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:50:58+00:00 2026-05-12T19:50:58+00:00

I have a question about how to make marquee text smooth (using Qt 4.5.3)

  • 0

I have a question about how to make marquee text smooth (using Qt 4.5.3) on not powerful hardware (Atom N270 + Intel 945GSM). My approach is as follows:

  1. I draw my text (36px Arial bold) onto a QPixmap (off-screen paint device)
  2. I set a timer to shift 1px content to left in each 30ms.
  3. When onTimer event is triggered, I make a selection of the QPixmap and print this part onto the window canvas.

Generally speaking, it moves smoothly. However, the more marquee text I create, the more CPU usage it reaches. When text can fill 50% screen (1920×1680), the CPU usage is about 70-80%. Text animation becomes a bit flickered. If I set timer interval to 50ms or larger, it will be smooth. But text moves too slow.

Is my approach ineffective? Shall I use OpenGL? Any hint is welcome and thanks in advance ^^)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T19:50:59+00:00Added an answer on May 12, 2026 at 7:50 pm

    You should look into the Graphics View framework. You can add QGraphicsTextItem objects to a QGraphicsScene, and set the coordinates of the view (zoom and translation) to make your text move and appear whatever size you want, including having some of the text to be “off screen” (outside the view). I would expect this to be much more efficient than copying and painting a (varying size) portion of a QPixmap every timer event.

    The documentation states that the Graphics View framework is optimized to handle many objects at once. If it turns out to not be any better, you might want to give the 4.6 beta a try. There are optimizations coming for the Graphics View rendering.

    As an aside, I would look at QTimeLine for helping you to drive the animation. Besides providing basic “ticks” every so often, you can set “curve shapes” that can start out slow and speed up, or slow down as the end approaches. Just beware that if you want to restart your QTimeLine after the finished() signal, if you change the duration and call start() without calling setCurrentTime(0), the timer will start with the old duration as the current time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.