Frapper  1.0a
Public Slots | Signals | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
Frapper::TimelineWidget Class Reference

Class for a timeline widget for accessing the scene model's time. More...

#include <TimelineWidget.h>

Inheritance diagram for Frapper::TimelineWidget:
Inheritance graph
[legend]
Collaboration diagram for Frapper::TimelineWidget:
Collaboration graph
[legend]

Public Slots

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.
 

Signals

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.
 

Public Member Functions

 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 Public Attributes

static const QSize DefaultFrameSize = QSize(5, 17)
 The default size of frame rectangles (should be odd numbers).
 

Protected Member Functions

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.
 

Private Slots

void on_m_currentFrameEdit_returnPressed ()
 Slot that is called when the return key has been pressed while the current frame line edit has focus.
 

Private Member Functions

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.
 
GrabberWidgetgrabberAt (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.
 

Private Attributes

QImage m_image
 The image that will be used for painting the widget.
 
QScrollArea * m_parentScrollArea
 The scroll area in which the timeline widget resides.
 
GrabberWidgetm_startGrabber
 The start frame grabber widget.
 
GrabberWidgetm_endGrabber
 The end frame grabber widget.
 
GrabberWidgetm_inGrabber
 The in frame grabber widget.
 
GrabberWidgetm_outGrabber
 The out frame grabber widget.
 
GrabberWidgetm_currentGrabber
 The current frame grabber widget.
 
GrabberWidgetm_movedGrabber
 The grabber that is currently moved in the timeline.
 
QLineEdit * m_currentFrameEdit
 The widget for editing the index of the current frame.
 
QIntValidator * m_currentFrameValidator
 The validator to use when editing the index of the current frame.
 
bool m_autoScroll
 Flag that states whether automatic scrolling of the parent scroll area is enabled.
 
int m_frameWidth
 The width of frame rectangles (should be an odd number).
 
int m_frameHeight
 The heigth of frame rectangles (should be an odd number).
 
int m_tickStep
 The step size for indices for which ticks will be drawn in the widget.
 

Detailed Description

Class for a timeline widget for accessing the scene model's time.

Constructor & Destructor Documentation

Frapper::TimelineWidget::TimelineWidget ( QWidget *  parent = 0,
Qt::WindowFlags  flags = 0 
)

Constructor of the TimelineWidget class.

Constructors and Destructors.

Parameters
parentThe parent widget the created instance will be a child of.
flagsExtra widget options.

Constructor of the TimelineWidget class.

Parameters
parentThe parent widget the created instance will be a child of.
flagsExtra 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.

Member Function Documentation

void Frapper::TimelineWidget::setCurrentFrame ( int  index)

Sets the index of the current frame in the scene's time.

Public Functions.

Parameters
indexThe new index of the current frame in the scene's time.

Sets the index of the current frame in the scene's time.

Parameters
indexThe 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
indexThe 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
indexThe new index of the end frame in the scene's time.
indexThe 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
indexThe 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
indexThe 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
inToOutFlag 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
autoScrollThe 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
autoScrollThe 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
frameWidthThe 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
indexThe 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
indexThe 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
indexThe 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
indexThe 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
indexThe 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
eventThe object containing details about the event.

Event handler that reacts to paint events.

Parameters
eventThe object containing details about the event.
void Frapper::TimelineWidget::keyPressEvent ( QKeyEvent *  event)
protectedvirtual

Event handler that reacts to key press events.

Parameters
eventThe object containing details about the event.
void Frapper::TimelineWidget::mouseDoubleClickEvent ( QMouseEvent *  event)
protectedvirtual

Event handler that reacts to mouse double clicks.

Parameters
eventThe object containing details about the event.
void Frapper::TimelineWidget::mouseMoveEvent ( QMouseEvent *  event)
protectedvirtual

Event handler that reacts to mouse movement.

Parameters
eventThe object containing details about the event.
void Frapper::TimelineWidget::mousePressEvent ( QMouseEvent *  event)
protectedvirtual

Event handler that reacts to mouse clicks.

Parameters
eventThe object containing details about the event.
void Frapper::TimelineWidget::mouseReleaseEvent ( QMouseEvent *  event)
protectedvirtual

Event handler that reacts to the release of mouse buttons.

Parameters
eventThe 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
rectangleThe 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
positionThe position of the mouse pointer over the widget.
rangeGrabbersOnlyFlag 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
startEditingFlag 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.

Member Data Documentation

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.

GrabberWidget* Frapper::TimelineWidget::m_startGrabber
private

The start frame grabber widget.

GrabberWidget* Frapper::TimelineWidget::m_endGrabber
private

The end frame grabber widget.

GrabberWidget* Frapper::TimelineWidget::m_inGrabber
private

The in frame grabber widget.

GrabberWidget* Frapper::TimelineWidget::m_outGrabber
private

The out frame grabber widget.

GrabberWidget* Frapper::TimelineWidget::m_currentGrabber
private

The current frame grabber widget.

GrabberWidget* Frapper::TimelineWidget::m_movedGrabber
private

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: