Frapper  1.0a
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Frapper::GrabberWidget Class Reference

Class for a widget representing a frame grabber in a timeline. More...

#include <GrabberWidget.h>

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

Public Types

enum  Position { P_BeforeFrame = -1, P_OnFrame, P_AfterFrame }
 Nested enumeration of grabber position types specifying where to place grabber widgets relative to the rectangles of the frames that they represent. More...
 

Public Member Functions

 GrabberWidget (const QSize &frameRectangleSize, Position position, const QColor &baseColor, QWidget *parent=0, Qt::WindowFlags flags=0)
 Constructor of the GrabberWidget class.
 
virtual ~GrabberWidget ()
 Destructor of the GrabberWidget class.
 
int getFrameIndex () const
 Returns the index of the frame that the grabber represents.
 
void setFrameIndex (int index)
 Sets the index of the frame that the grabber represents.
 
void setFrameWidth (int frameWidth)
 Sets the width used for frame rectangles in the timeline widget to the given width.
 
void setStartFrameIndex (int index)
 Sets the index of the start frame in the animation range.
 

Static Public Attributes

static const int Width = 5
 The width of frame grabbers (should be an odd number).
 

Protected Member Functions

virtual void paintEvent (QPaintEvent *event)
 Event handler that reacts to paint events.
 

Private Member Functions

void updatePosition ()
 Updates the position of the widget according to the index of the frame that it represents and the frame width.
 

Private Attributes

int m_frameIndex
 The index of the frame the grabber represents.
 
QSize m_frameRectangleSize
 The size of frame rectangles in the timeline widget.
 
Position m_position
 The grabber's position type specifying where to place the widget relative to the rectangle of the frame that it represents.
 
QColor m_baseColor
 The base color that is used for painting the widget.
 
int m_startFrameIndex
 The index of the start frame in the animation range.
 

Detailed Description

Class for a widget representing a frame grabber in a timeline.

Member Enumeration Documentation

Nested enumeration of grabber position types specifying where to place grabber widgets relative to the rectangles of the frames that they represent.

Enumerator:
P_BeforeFrame 

A value indicating that the grabber should be placed before the frame that it represents.

P_OnFrame 

A value indicating that the grabber should be placed on the frame that it represents.

P_AfterFrame 

A value indicating that the grabber should be placed after the frame that it represents.

Constructor & Destructor Documentation

Frapper::GrabberWidget::GrabberWidget ( const QSize &  frameRectangleSize,
GrabberWidget::Position  position,
const QColor &  baseColor,
QWidget *  parent = 0,
Qt::WindowFlags  flags = 0 
)

Constructor of the GrabberWidget class.

Constructors and Destructors.

Parameters
frameRectangleSizeThe width of frame rectangles (used for positioning the widget).
positionThe grabber position type.
baseColorThe base color to use for painting the widget.
parentThe parent widget the created instance will be a child of.
flagsExtra widget options.

Constructor of the GrabberWidget class.

Parameters
frameRectangleSizeThe width of frame rectangles (used for positioning the widget).
positionThe grabber position type.
baseColorThe base color to use for painting the widget.
parentThe parent widget the created instance will be a child of.
flagsExtra widget options.
Frapper::GrabberWidget::~GrabberWidget ( )
virtual

Destructor of the GrabberWidget 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

int Frapper::GrabberWidget::getFrameIndex ( ) const

Returns the index of the frame that the grabber represents.

Public Functions.

Returns
The index of the frame that the grabber represents.

Returns the index of the frame that the grabber represents.

Returns
The index of the frame that the grabber represents.
void Frapper::GrabberWidget::setFrameIndex ( int  index)

Sets the index of the frame that the grabber represents.

Parameters
indexThe index of the frame that the grabber represents.
void Frapper::GrabberWidget::setFrameWidth ( int  frameWidth)

Sets the width used for frame rectangles in the timeline widget to the given width.

Parameters
frameWidthThe width of frame rectangles in the timeline widget.
void Frapper::GrabberWidget::setStartFrameIndex ( int  index)

Sets the index of the start frame in the animation range.

Parameters
indexThe index of the start frame in the animation range.
void Frapper::GrabberWidget::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::GrabberWidget::updatePosition ( )
private

Updates the position of the widget according to the index of the frame that it represents and the frame width.

Private Functions.

Member Data Documentation

const int Frapper::GrabberWidget::Width = 5
static

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

int Frapper::GrabberWidget::m_frameIndex
private

The index of the frame the grabber represents.

QSize Frapper::GrabberWidget::m_frameRectangleSize
private

The size of frame rectangles in the timeline widget.

Used for positioning the grabber widget.

Position Frapper::GrabberWidget::m_position
private

The grabber's position type specifying where to place the widget relative to the rectangle of the frame that it represents.

QColor Frapper::GrabberWidget::m_baseColor
private

The base color that is used for painting the widget.

int Frapper::GrabberWidget::m_startFrameIndex
private

The index of the start frame in the animation range.

Used for positioning the grabber widget.


The documentation for this class was generated from the following files: