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. How to let the QLabel display the differenet QPixmap in a for loop?

How to let the QLabel display the differenet QPixmap in a for loop?

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

    How to let the QLabel display the differenet QPixmap in a for loop?

    in my case,the QLabel will not display the QPixmap real time....How to make it?

    PS:The loop is in one slot function.

    Should it use the double buffer?

    VS2008+QT

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      As your application is trapped in the for loop, the QLabel has no chance to execute its paint code to repaint itself with the new pixmap. You will have to use a QTimer, which repeatedly calls the slot, which no longer contains a loop, but instead just sets the next pixmap on the label.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        giesbert
        wrote on last edited by
        #3

        Or you call pLabel->repaint (which leads to a direct repaint).

        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
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          ... which renders your application quite unusable as well, because there is still no event processing.

          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