Changeset 8226:a1e2e6c8ca17 in orange


Ignore:
Timestamp:
08/19/11 09:12:23 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
ad3e6ae81bdca86e29411f3e5063b0fa59c03988
Message:

Don't use animations in C++ if they are disabled.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orangeqt/plotitem.cpp

    r8171 r8226  
    136136void PlotItem::move_item(QGraphicsObject* item, const QPointF& pos, bool animate, int duration) 
    137137{ 
    138     QPropertyAnimation* a = new QPropertyAnimation(item, "pos", item); 
    139     a->setEndValue(pos); 
    140     a->setDuration(duration); 
    141     a->start(QAbstractAnimation::DeleteWhenStopped); 
     138    if (animate) 
     139    { 
     140        QPropertyAnimation* a = new QPropertyAnimation(item, "pos", item); 
     141        a->setEndValue(pos); 
     142        a->setDuration(duration); 
     143        a->start(QAbstractAnimation::DeleteWhenStopped); 
     144    } 
     145    else 
     146    { 
     147        item->setPos(pos); 
     148    } 
    142149} 
    143150 
Note: See TracChangeset for help on using the changeset viewer.