TimelineWidget Class Reference

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

#include <TimelineWidget.h>

Collaboration diagram for TimelineWidget:

Collaboration graph
[legend]

List of all members.

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(9, 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

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.

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 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 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 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 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 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 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 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 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 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 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 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 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 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 TimelineWidget::paintEvent ( QPaintEvent *  event  )  [protected, virtual]

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 TimelineWidget::keyPressEvent ( QKeyEvent *  event  )  [protected, virtual]

Event handler that reacts to key press events.

Parameters:
event The object containing details about the event.

void TimelineWidget::mouseDoubleClickEvent ( QMouseEvent *  event  )  [protected, virtual]

Event handler that reacts to mouse double clicks.

Parameters:
event The object containing details about the event.

void TimelineWidget::mouseMoveEvent ( QMouseEvent *  event  )  [protected, virtual]

Event handler that reacts to mouse movement.

Parameters:
event The object containing details about the event.

void TimelineWidget::mousePressEvent ( QMouseEvent *  event  )  [protected, virtual]

Event handler that reacts to mouse clicks.

Parameters:
event The object containing details about the event.

void TimelineWidget::mouseReleaseEvent ( QMouseEvent *  event  )  [protected, virtual]

Event handler that reacts to the release of mouse buttons.

Parameters:
event The object containing details about the event.

void 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 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 * 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 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 TimelineWidget::on_m_currentFrameEdit_returnPressed (  )  [private, slot]

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 TimelineWidget::DefaultFrameSize = QSize(9, 17) [static]

The default size of frame rectangles (should be odd numbers).

Public Static Data.

QImage TimelineWidget::m_image [private]

The image that will be used for painting the widget.

QScrollArea* 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* TimelineWidget::m_currentFrameEdit [private]

The widget for editing the index of the current frame.

QIntValidator* TimelineWidget::m_currentFrameValidator [private]

The validator to use when editing the index of the current frame.

Flag that states whether automatic scrolling of the parent scroll area is enabled.

The width of frame rectangles (should be an odd number).

The heigth of frame rectangles (should be an odd number).

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:

Generated on Wed Feb 24 15:01:03 2010 for Frapper by  doxygen 1.5.9