Changeset 8386:f1b7099cd5cb in orange


Ignore:
Timestamp:
07/08/11 16:20:43 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
17fda00a467a216636f561d6775ded6b9f72f33f
Message:

Cancel the previous threaded update before starting a new one

Location:
source/orangeplot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • source/orangeplot/curve.cpp

    r8382 r8386  
    5555void Curve::updateProperties() 
    5656{ 
    57   qDebug() << "Updating curve " << m_needsUpdate; 
    5857  setContinuous(m_style != Curve::NoCurve); 
    5958   
     
    523522{ 
    524523    m_zoom_factor = factor; 
    525     qDebug() << "zoom factor is now" << factor; 
    526524    m_needsUpdate |= UpdateZoom; 
    527525    checkForUpdate(); 
     
    530528void Curve::updateItems(const QList< QGraphicsPathItem* >& items, Updater updater) 
    531529{ 
    532     qDebug() << "Updating items asynchronously"; 
    533     qDebug() << updater.m_scale; 
    534     QtConcurrent::map(items, updater); 
    535 } 
     530    if (m_currentUpdate.isRunning()) 
     531    { 
     532        m_currentUpdate.cancel(); 
     533        m_currentUpdate.waitForFinished(); 
     534    } 
     535    m_currentUpdate = QtConcurrent::map(items, updater); 
     536} 
  • source/orangeplot/curve.h

    r8382 r8386  
    237237  QBrush m_brush; 
    238238  double m_zoom_factor; 
     239  QFuture<void> m_currentUpdate; 
    239240}; 
    240241 
Note: See TracChangeset for help on using the changeset viewer.