Class for a timeline widget for accessing the scene model's time.
More...
#include <TimelineWidget.h>
|
void | setAutoScroll (bool autoScroll) |
| Enables or disables automatic scrolling of the widget's parent scroll area to ensure the current frame is visible.
|
|
void | setFrameWidth (int frameWidth) |
| Sets the width of frame rectangles to the given width.
|
|
|
void | currentFrameSet (int index) |
| Signal that is emitted when the index of the current frame in the scene's time has been changed.
|
|
void | startFrameSet (int index) |
| Signal that is emitted when the index of the start frame in the scene's time has been changed.
|
|
void | endFrameSet (int index) |
| Signal that is emitted when the index of the end frame in the scene's time has been changed.
|
|
void | inFrameSet (int index) |
| Signal that is emitted when the index of the in frame in the scene's time has been changed.
|
|
void | outFrameSet (int index) |
| Signal that is emitted when the index of the out frame in the scene's time has been changed.
|
|
|
| TimelineWidget (QWidget *parent=0, Qt::WindowFlags flags=0) |
| Constructor of the TimelineWidget class.
|
|
virtual | ~TimelineWidget () |
| Destructor of the TimelineWidget class.
|
|
void | setCurrentFrame (int index) |
| Sets the index of the current frame in the scene's time.
|
|
void | setStartFrame (int index) |
| Sets the index of the start frame in the scene's time.
|
|
void | setEndFrame (int index) |
| Sets the index of the end frame in the scene's time.
|
|
void | setInFrame (int index) |
| Sets the index of the in frame in the scene's time.
|
|
void | setOutFrame (int index) |
| Sets the index of the out frame in the scene's time.
|
|
int | calculateFrameWidth (bool inToOut=false) |
| Calculates the optimum frame width for fitting all frames from start to end frame (or in to out frame) into the timeline widgets dimensions.
|
|
|
static const QSize | DefaultFrameSize = QSize(5, 17) |
| The default size of frame rectangles (should be odd numbers).
|
|
|
virtual void | paintEvent (QPaintEvent *event) |
| Event handler that reacts to paint events.
|
|
virtual void | keyPressEvent (QKeyEvent *event) |
| Event handler that reacts to key press events.
|
|
virtual void | mouseDoubleClickEvent (QMouseEvent *event) |
| Event handler that reacts to mouse double clicks.
|
|
virtual void | mouseMoveEvent (QMouseEvent *event) |
| Event handler that reacts to mouse movement.
|
|
virtual void | mousePressEvent (QMouseEvent *event) |
| Event handler that reacts to mouse clicks.
|
|
virtual void | mouseReleaseEvent (QMouseEvent *event) |
| Event handler that reacts to the release of mouse buttons.
|
|
|
void | updateWidth () |
| Updates the width of the timeline widget depending on the current start and end frames and the current frame width.
|
|
void | paintImage (const QRect &rectangle) |
| Paints a part of the image that is drawn when painting the widget.
|
|
GrabberWidget * | grabberAt (const QPoint &position, bool rangeGrabbersOnly=true) |
| Returns the grabber at the given mouse pointer position.
|
|
void | editCurrentFrame (bool startEditing=true) |
| Enters or leaves the mode for editing the index of the current frame.
|
|
Class for a timeline widget for accessing the scene model's time.
Frapper::TimelineWidget::TimelineWidget |
( |
QWidget * |
parent = 0 , |
|
|
Qt::WindowFlags |
flags = 0 |
|
) |
| |
Constructor of the TimelineWidget class.
Constructors and Destructors.
- Parameters
-
parent | The parent widget the created instance will be a child of. |
flags | Extra widget options. |
Constructor of the TimelineWidget class.
- Parameters
-
parent | The parent widget the created instance will be a child of. |
flags | Extra widget options. |
Frapper::TimelineWidget::~TimelineWidget |
( |
| ) |
|
|
virtual |
Destructor of the TimelineWidget class.
Defined virtual to guarantee that the destructor of a derived class will be called if the instance of the derived class is saved in a variable of its parent class type.
void Frapper::TimelineWidget::setCurrentFrame |
( |
int |
index | ) |
|
Sets the index of the current frame in the scene's time.
Public Functions.
- Parameters
-
index | The new index of the current frame in the scene's time. |
Sets the index of the current frame in the scene's time.
- Parameters
-
index | The new index of the current frame in the scene's time. |
void Frapper::TimelineWidget::setStartFrame |
( |
int |
index | ) |
|
Sets the index of the start frame in the scene's time.
- Parameters
-
index | The new index of the start frame in the scene's time. |
void Frapper::TimelineWidget::setEndFrame |
( |
int |
index | ) |
|
Sets the index of the end frame in the scene's time.
- Parameters
-
index | The new index of the end frame in the scene's time. |
index | The new index of the start frame in the scene's time. |
void Frapper::TimelineWidget::setInFrame |
( |
int |
index | ) |
|
Sets the index of the in frame in the scene's time.
- Parameters
-
index | The new index of the in frame in the scene's time. |
void Frapper::TimelineWidget::setOutFrame |
( |
int |
index | ) |
|
Sets the index of the out frame in the scene's time.
- Parameters
-
index | The new index of the out frame in the scene's time. |
int Frapper::TimelineWidget::calculateFrameWidth |
( |
bool |
inToOut = false | ) |
|
Calculates the optimum frame width for fitting all frames from start to end frame (or in to out frame) into the timeline widgets dimensions.
- Parameters
-
inToOut | Flag to control whether to calculate the optimum frame width for the range from in to out frame instead of the start to end frame. |
- Returns
- The frame width at which all frames in the frame range fit into the timeline widgets dimensions.
void Frapper::TimelineWidget::setAutoScroll |
( |
bool |
autoScroll | ) |
|
|
slot |
Enables or disables automatic scrolling of the widget's parent scroll area to ensure the current frame is visible.
Public Slots.
- Parameters
-
autoScroll | The new value for the automatic scrolling flag. |
Enables or disables automatic scrolling of the widget's parent scroll area to ensure the current frame is visible.
- Parameters
-
autoScroll | The new value for the automatic scrolling flag. |
void Frapper::TimelineWidget::setFrameWidth |
( |
int |
frameWidth | ) |
|
|
slot |
Sets the width of frame rectangles to the given width.
- Parameters
-
frameWidth | The width to use for frame rectangles. |
void Frapper::TimelineWidget::currentFrameSet |
( |
int |
index | ) |
|
|
signal |
Signal that is emitted when the index of the current frame in the scene's time has been changed.
- Parameters
-
index | The new index of the current frame in the scene's time. |
void Frapper::TimelineWidget::startFrameSet |
( |
int |
index | ) |
|
|
signal |
Signal that is emitted when the index of the start frame in the scene's time has been changed.
- Parameters
-
index | The new index of the start frame in the scene's time. |
void Frapper::TimelineWidget::endFrameSet |
( |
int |
index | ) |
|
|
signal |
Signal that is emitted when the index of the end frame in the scene's time has been changed.
- Parameters
-
index | The new index of the end frame in the scene's time. |
void Frapper::TimelineWidget::inFrameSet |
( |
int |
index | ) |
|
|
signal |
Signal that is emitted when the index of the in frame in the scene's time has been changed.
- Parameters
-
index | The new index of the in frame in the scene's time. |
void Frapper::TimelineWidget::outFrameSet |
( |
int |
index | ) |
|
|
signal |
Signal that is emitted when the index of the out frame in the scene's time has been changed.
- Parameters
-
index | The new index of the out frame in the scene's time. |
void Frapper::TimelineWidget::paintEvent |
( |
QPaintEvent * |
event | ) |
|
|
protectedvirtual |
Event handler that reacts to paint events.
Protected Event Handlers.
- Parameters
-
event | The object containing details about the event. |
Event handler that reacts to paint events.
- Parameters
-
event | The object containing details about the event. |
void Frapper::TimelineWidget::keyPressEvent |
( |
QKeyEvent * |
event | ) |
|
|
protectedvirtual |
Event handler that reacts to key press events.
- Parameters
-
event | The object containing details about the event. |
void Frapper::TimelineWidget::mouseDoubleClickEvent |
( |
QMouseEvent * |
event | ) |
|
|
protectedvirtual |
Event handler that reacts to mouse double clicks.
- Parameters
-
event | The object containing details about the event. |
void Frapper::TimelineWidget::mouseMoveEvent |
( |
QMouseEvent * |
event | ) |
|
|
protectedvirtual |
Event handler that reacts to mouse movement.
- Parameters
-
event | The object containing details about the event. |
void Frapper::TimelineWidget::mousePressEvent |
( |
QMouseEvent * |
event | ) |
|
|
protectedvirtual |
Event handler that reacts to mouse clicks.
- Parameters
-
event | The object containing details about the event. |
void Frapper::TimelineWidget::mouseReleaseEvent |
( |
QMouseEvent * |
event | ) |
|
|
protectedvirtual |
Event handler that reacts to the release of mouse buttons.
- Parameters
-
event | The object containing details about the event. |
void Frapper::TimelineWidget::updateWidth |
( |
| ) |
|
|
private |
Updates the width of the timeline widget depending on the current start and end frames and the current frame width.
Private Functions.
void Frapper::TimelineWidget::paintImage |
( |
const QRect & |
rectangle | ) |
|
|
private |
Paints a part of the image that is drawn when painting the widget.
- Parameters
-
rectangle | The area of the image to paint. |
GrabberWidget * Frapper::TimelineWidget::grabberAt |
( |
const QPoint & |
position, |
|
|
bool |
rangeGrabbersOnly = true |
|
) |
| |
|
private |
Returns the grabber at the given mouse pointer position.
- Parameters
-
position | The position of the mouse pointer over the widget. |
rangeGrabbersOnly | Flag to control whether to only check if a frame range grabber is located at the given position. |
- Returns
- The grabber at the given mouse pointer position.
void Frapper::TimelineWidget::editCurrentFrame |
( |
bool |
startEditing = true | ) |
|
|
private |
Enters or leaves the mode for editing the index of the current frame.
- Parameters
-
startEditing | Flag to control whether to start or stop editing the current frame index. |
void Frapper::TimelineWidget::on_m_currentFrameEdit_returnPressed |
( |
| ) |
|
|
privateslot |
Slot that is called when the return key has been pressed while the current frame line edit has focus.
Private Slots.
Sets the entered index as the new index for the current frame.
Slot that is called when the return key has been pressed while the current frame line edit has focus.
Sets the entered index as the new index for the current frame.
const QSize Frapper::TimelineWidget::DefaultFrameSize = QSize(5, 17) |
|
static |
The default size of frame rectangles (should be odd numbers).
Public Static Data.
QImage Frapper::TimelineWidget::m_image |
|
private |
The image that will be used for painting the widget.
QScrollArea* Frapper::TimelineWidget::m_parentScrollArea |
|
private |
The scroll area in which the timeline widget resides.
The start frame grabber widget.
The end frame grabber widget.
The in frame grabber widget.
The out frame grabber widget.
The current frame grabber widget.
The grabber that is currently moved in the timeline.
QLineEdit* Frapper::TimelineWidget::m_currentFrameEdit |
|
private |
The widget for editing the index of the current frame.
QIntValidator* Frapper::TimelineWidget::m_currentFrameValidator |
|
private |
The validator to use when editing the index of the current frame.
bool Frapper::TimelineWidget::m_autoScroll |
|
private |
Flag that states whether automatic scrolling of the parent scroll area is enabled.
int Frapper::TimelineWidget::m_frameWidth |
|
private |
The width of frame rectangles (should be an odd number).
int Frapper::TimelineWidget::m_frameHeight |
|
private |
The heigth of frame rectangles (should be an odd number).
int Frapper::TimelineWidget::m_tickStep |
|
private |
The step size for indices for which ticks will be drawn in the widget.
The documentation for this class was generated from the following files: