CopperSpice API  1.9.2
QScrollEvent Class Reference

The QScrollEvent class is sent when scrolling. More...

Inheritance diagram for QScrollEvent:
QEvent

Public Methods

 QScrollEvent (const QPointF &contentPos, const QPointF &overshootDistance, ScrollState scrollState)
 
 ~QScrollEvent ()
 
QPointF contentPos () const
 
QPointF overshootDistance () const
 
ScrollState scrollState () const
 
- Public Methods inherited from QEvent
 QEvent (const QEvent &other)
 
 QEvent (Type type)
 
virtual ~QEvent ()
 
void accept ()
 
void ignore ()
 
bool isAccepted () const
 
QEvent & operator= (const QEvent &other)
 
void setAccepted (bool accepted)
 
bool spontaneous () const
 
Type type () const
 

Additional Inherited Members

- Public Types inherited from QEvent
enum  Type
 
- Static Public Methods inherited from QEvent
static int registerEventType (int hint=-1)
 

Detailed Description

The QScrollEvent class is sent when scrolling. The scroll event is sent to indicate the receiver should be scrolled. Usually the receiver will be a QWidget or QGraphicsObject. Care should be taken that no conflicting QScrollEvents are sent from two sources.

See also
QScrollPrepareEvent, QScroller

Constructor & Destructor Documentation

QScrollEvent::QScrollEvent ( const QPointF contentPos,
const QPointF overshootDistance,
ScrollState  scrollState 
)

Creates a new QScrollEvent with contentPos as the new content position. The value for overshootDistance is the new overshoot distance and scrollState indicates if this scroll event is the first one, the last one, or some event in between.

Refer to QScroller for an explanation of the term overshoot.

QScrollEvent::~QScrollEvent ( )

Destroys QScrollEvent.

Method Documentation

QPointF QScrollEvent::contentPos ( ) const

Returns the new scroll position.

QPointF QScrollEvent::overshootDistance ( ) const

Returns the new overshoot distance. Refer to QScroller for an explanation of the term overshoot.

See also
QScroller
ScrollState QScrollEvent::scrollState ( ) const

Returns the current scroll state as a combination of ScrollStateFlag values. ScrollStarted or ScrollFinished will be set if this scroll event is the first or last event in a scrolling activity.

It is worth noting that both values can be set at the same time, if the activity consists of a single QScrollEvent. All other scroll events in between will have their state set to ScrollUpdated.