Added possibility to setCurrentFrame without emitting a signal

This commit is contained in:
Magne Sjaastad 2015-09-04 11:40:44 +02:00
parent c86dc45fd6
commit 89fa5ecef7
2 changed files with 14 additions and 0 deletions

View File

@ -157,6 +157,19 @@ int FrameAnimationControl::currentFrame() const
return m_currentFrame;
}
//--------------------------------------------------------------------------------------------------
/// Set current frame without emitting signal
/// Used when views are linked and need to update current frame without emitting a signal
/// Emitting a signal will cause infinite recursion
//--------------------------------------------------------------------------------------------------
void FrameAnimationControl::setCurrentFrameOnly(int frameIndex)
{
if (frameIndex >= 0)
{
m_currentFrame = frameIndex;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -58,6 +58,7 @@ public:
void setNumFrames(int numFrames);
int numFrames() const;
int currentFrame() const;
void setCurrentFrameOnly(int frameIndex);
bool isActive() const;