Interesting, never used mutable before but it seems to work fine. However, I bet if my C++ professor were around, I'd probably get a slap on the hand...
 Novice
					
					
						Novice
					
					
                                        
					
						
							
								 
							
						
					
					
						 
    
    
       
    
    
    
    
    
   
    
    
       
    
    
    
    
   Re: Redrawing a single row of a QwtPlotSpectrogram
 Re: Redrawing a single row of a QwtPlotSpectrogram
		Interesting, never used mutable before but it seems to work fine. However, I bet if my C++ professor were around, I'd probably get a slap on the hand...
 Novice
					
					
						Novice
					
					
                                        
					
						
							
								 
							
						
					
					
						 
    
    
       
    
    
    
    
    
   
    
    
       
    
    
    
    
   Re: Redrawing a single row of a QwtPlotSpectrogram
 Re: Redrawing a single row of a QwtPlotSpectrogram
		Got it working!! Very smooth scrolling animation now. Uwe, thanks so much for your help!
 Novice
					
					
						Novice
					
					
                                        
					
						
							
								 
							
						
					
					
						 
    
    
       
    
    
    
    
    
   
    
    
       
    
    
    
    
   Re: Redrawing a single row of a QwtPlotSpectrogram
 Re: Redrawing a single row of a QwtPlotSpectrogram
		Although I've achieved my original goal, I'm now looking to generate large plots quicker and more efficiently. How much of a change would be involved to use OpenGL to paint plots instead of QPainter? I'm assuming I'll need to subclass QwtPlot? Uwe, any advice/direction?
 Expert
					
					
						Expert
					
					
                                        
					
						
							
								 
							
								 
							
								 
							
								 
							
								 
							
								 
							
								 
							
								 
							
								 
							
								 
							
								 
							
						
					
					
						 
    
    
       
    
    
    
       
    
    
    
    
   
    
    
       
    
    
       
    
    
    
    
   Re: Redrawing a single row of a QwtPlotSpectrogram
 Re: Redrawing a single row of a QwtPlotSpectrogram
		First of all I would optimize the existing solution and turn all paint caches off, because you have your own image cache:
a) Spectrogram item
Qt Code:
To copy to clipboard, switch view to plain text mode
b) Plot canvas
c) Qt ( only supported on X11 )Qt Code:
To copy to clipboard, switch view to plain text mode
Qt Code:
plot->canvas()->setAttribute(Qt::WA_PaintOnScreen, true);To copy to clipboard, switch view to plain text mode
Another optimization on multicore systems is to render parts of the image parallel in several threads.
Uwe
 Novice
					
					
						Novice
					
					
                                        
					
						
							
								 
							
						
					
					
						 
    
    
       
    
    
    
    
    
   
    
    
       
    
    
    
    
   Re: Redrawing a single row of a QwtPlotSpectrogram
 Re: Redrawing a single row of a QwtPlotSpectrogram
		Thanks! I'd already applied a) (the default is NoCache I think). I just applied b), and it sped things up a little. I'm using Windows (unfortunately), so c) doesn't apply.
For the most part, I'm getting the performance I need, so moving rendering to the GPU isn't absolutely necessary for me. My profiler says that most of the work is being done in qdrawhelper_p in some low-level math functions, so I don't think there's a higher level bottleneck. However, for a 1024x768 canvas, I'd like to be able to do 30 draws a second. Right now I can only get to ~20. (For smaller canvas, I have no problem with 30).
Bookmarks