#include <AnimationFrameSpinBox.h>
Signals | |
| void | frameChanged (const AnimationFrame &frame) |
Public Member Functions | |
| AnimationFrameSpinBox (QWidget *pParent) | |
| virtual | ~AnimationFrameSpinBox () |
| void | setFrames (const std::vector< AnimationFrame > &frames, FrameType type) |
| void | setFrames (AnimationController *pController) |
| void | setFrames (Animation *pAnimation) |
| const std::vector < AnimationFrame > & | getFrames () const |
| void | setCurrentFrame (const AnimationFrame &frame) |
| const AnimationFrame & | getCurrentFrame () const |
| virtual void | stepBy (int steps) |
| FrameType | getFrameType () const |
Protected Member Functions | |
| virtual StepEnabled | stepEnabled () const |
| virtual QString | convertToText (int index) |
There are two types of animations: frame-based that uses frame values to go though the frames and time-based that go though frames by using the number of seconds since January 1, 1970. This spin box will handle both of these types.
Definition at line 30 of file AnimationFrameSpinBox.h.
| AnimationFrameSpinBox::AnimationFrameSpinBox | ( | QWidget * | pParent | ) |
Creates a new animation spin box.
| pParent | The parent widget. |
| virtual AnimationFrameSpinBox::~AnimationFrameSpinBox | ( | ) | [virtual] |
Destroys the spin box.
| void AnimationFrameSpinBox::setFrames | ( | const std::vector< AnimationFrame > & | frames, | |
| FrameType | type | |||
| ) |
This method will set up the vector of animation frames that will be used in the spin box.
| frames | the animation frame vector. | |
| type | The animation type. |
| void AnimationFrameSpinBox::setFrames | ( | AnimationController * | pController | ) |
This method will set up the vector of animation frames that will be used in the spin box.
| pController | the controller that holds the animation frames. |
| void AnimationFrameSpinBox::setFrames | ( | Animation * | pAnimation | ) |
This method will set up the vector of animation frames that will be used in the spin box.
| pAnimation | A set of animation frames. |
| const std::vector<AnimationFrame>& AnimationFrameSpinBox::getFrames | ( | ) | const |
Returns a vector containing the spin box frames.
| void AnimationFrameSpinBox::setCurrentFrame | ( | const AnimationFrame & | frame | ) |
This method will make the spin box select the given animation frame if it's in the spin box.
| frame | The animation frame to set in the spin box. |
| const AnimationFrame& AnimationFrameSpinBox::getCurrentFrame | ( | ) | const |
This method will get the animation frame that is currently selected in the spin box.
| virtual void AnimationFrameSpinBox::stepBy | ( | int | steps | ) | [virtual] |
Updates the spin box text if the user triggers a step.
| steps | The number of steps. |
| FrameType AnimationFrameSpinBox::getFrameType | ( | ) | const |
Returns the type of animation.
| virtual StepEnabled AnimationFrameSpinBox::stepEnabled | ( | ) | const [protected, virtual] |
This method will determine whether the spin box can step up or step down.
| virtual QString AnimationFrameSpinBox::convertToText | ( | int | index | ) | [protected, virtual] |
This method will use the given index to get a frame from the animation frame vector and convert the frame value to text.
If there are no frames in the spin box, this method will return an empty string.
| index | The frame index used to convert the frame to text. |
| void AnimationFrameSpinBox::frameChanged | ( | const AnimationFrame & | frame | ) | [signal] |
Called when the spin box text has been changed.
| frame | The new selected frame in the spin box. |