Changeset 8c5e2a for src/UIElements


Ignore:
Timestamp:
Apr 11, 2018, 6:29:56 AM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.6.1, ChemicalSpaceEvaluator, Gui_displays_atomic_force_velocity, PythonUI_with_named_parameters, TremoloParser_IncreasedPrecision
Children:
2c97ad
Parents:
8ac6d0e
git-author:
Frederik Heber <frederik.heber@…> (08/09/17 10:21:27)
git-committer:
Frederik Heber <frederik.heber@…> (04/11/18 06:29:56)
Message:

FIX: QTimeLine now exactly controls world time.

Location:
src/UIElements/Views/Qt4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Views/Qt4/QtTimeLine.cpp

    r8ac6d0e r8c5e2a  
    5050    Observer("QtTimeLine"),
    5151    atomobserver_enlisted(false),
    52     worldtime_enlisted(false),
    53     WorldTime_change(false)
     52    worldtime_enlisted(false)
    5453{
    5554  // set initial values
    5655  QSlider::setMinimum(0);
    5756  QSlider::setMaximum(0);
    58   WorldTime_change = true;
    5957  QSlider::setValue(0);
    6058  QSlider::setTickInterval(1);
     
    6967
    7068  // connect to QSlider's valueChanged() signal
    71   bool result = connect(this,SIGNAL(valueChanged(int)),this,SLOT(StepUpdate(int)), Qt::DirectConnection);
     69  bool result = connect(this,SIGNAL(valueChanged(int)),this,SLOT(StepUpdate(int)));
    7270  if (!result)
    7371    ELOG(0, "Could not connect to QSlider::valueChanged.");
     
    116114      QSlider::setMaximum(timestep);
    117115    // set slider position to new time step
    118     WorldTime_change = true;
    119116    QSlider::setValue( timestep );
    120117  } else
     
    133130  boost::recursive_mutex::scoped_lock lock(refill_mutex);
    134131
    135   if (WorldTime_change)
    136     WorldTime_change = false;
    137   else
     132  if (WorldTime::getTime() != (unsigned int)position)
    138133    MoleCuilder::WorldSetWorldTime(position);
    139134}
  • src/UIElements/Views/Qt4/QtTimeLine.hpp

    r8ac6d0e r8c5e2a  
    4242  //!> whether WorldTime knows about us or not
    4343  bool worldtime_enlisted;
    44   //!> states whether value was set by observing WorldTime (and not by slider)
    45   bool WorldTime_change;
    4644
    4745  mutable boost::recursive_mutex refill_mutex;
Note: See TracChangeset for help on using the changeset viewer.