Improve particle system animation driver

- Do not automatically restart particle system animation when pressing the
  restart button if the animation is paused.
- Use own QElapsedTimer in AnimationDriver and properly handle animation
  driver pausing.

Change-Id: Ic2924fb66fddffb8878625be8fa766f06219ca61
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Antti Määttä
2021-11-22 13:32:14 +02:00
parent beb167a963
commit eadc9cb0e3
4 changed files with 39 additions and 23 deletions

View File

@@ -305,12 +305,6 @@ void Edit3DView::createEdit3DActions()
resetPuppet();
};
SelectionContextOperation particlesRestartTrigger = [this](const SelectionContext &) {
m_particlesPlayAction->action()->setChecked(true);
if (m_seeker)
m_seeker->setEnabled(false);
};
SelectionContextOperation particlesPlayTrigger = [this](const SelectionContext &) {
if (m_seeker)
m_seeker->setEnabled(!m_particlesPlayAction->action()->isChecked());
@@ -334,7 +328,7 @@ void Edit3DView::createEdit3DActions()
QmlDesigner::Constants::EDIT3D_PARTICLES_RESTART, View3DActionCommand::ParticlesRestart,
QCoreApplication::translate("ParticlesRestartAction", "Restart Particles"),
QKeySequence(Qt::Key_E), false, false, Icons::EDIT3D_PARTICLE_RESTART.icon(),
Icons::EDIT3D_PARTICLE_RESTART.icon(), particlesRestartTrigger);
Icons::EDIT3D_PARTICLE_RESTART.icon());
m_particlesPlayAction->action()->setEnabled(particlemode);
m_particlesRestartAction->action()->setEnabled(particlemode);
m_resetAction