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. Way to know when QGraphicsView is finished rendering?
Forum Updated to NodeBB v4.3 + New Features

Way to know when QGraphicsView is finished rendering?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 3.2k 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.
  • R Offline
    R Offline
    rickbkis
    wrote on last edited by
    #1

    I'm drawing several pixmaps in a QGraphicsView and need to put up a busy cursor until it's done.

    Problem is I haven't found a reliable way to know when this is - can't find a signal or event to intercept.

    I overloaded the paint() event, noticing that I was getting a paint event per pixmap. However, it's not consistent - sometimes I get fewer than expected paint() events. Apparently, it can draw more than one pixmap per event.

    So, that didn't work.

    Anyone know of a way to detect when QGraphicsView is done rendering?

    Thanks,
    rickb

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Chris H
      wrote on last edited by
      #2

      My understanding is that the notion of "done rendering" really translates to "there are no more paint events for this QGraphicsView in the queue," so there's not any sort of signal thrown like you are wanting. Could you just spin until there are no pending events at all?

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rickbkis
        wrote on last edited by
        #3

        Interesting thought. The problem I think is that something else might force a redraw - I'm only interested in the first one. Subsequent draws are fast. (Actually, the issue is I'm downloading images one at a time, but they get downloaded way before they get drawn...)

        Seems like QGraphicsView has to traverse all of the items in the scene - there ought to be a 'begin traverse' and 'end traverse' notification, somewhere, I would think (a not untypical scenegraph feature - OpenInventor, for instance))

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Chris H
          wrote on last edited by
          #4

          Looking at the code for the render() function in 4.7, it doesn't look like there are any signals being emitted during the process. Maybe there is something in the objects themselves?

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #5

            You are not downloading the images from the drawing code, are you?

            1 Reply Last reply
            0
            • R Offline
              R Offline
              rickbkis
              wrote on last edited by
              #6

              [quote author="Chris H" date="1323784331"]Looking at the code for the render() function in 4.7, it doesn't look like there are any signals being emitted during the process. Maybe there is something in the objects themselves?[/quote]

              Right - nor is the 'render()' function virtual, so you can't override it.

              [quote author="Andre" date="1323787413"]You are not downloading the images from the drawing code, are you?[/quote]

              Nope.

              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