CopperSpice API  1.7.2
QScrollPrepareEvent Class Reference

The QScrollPrepareEvent class is sent in preparation of scrolling. More...

Inheritance diagram for QScrollPrepareEvent:
QEvent

Public Methods

 QScrollPrepareEvent (const QPointF &startPos)
 
 ~QScrollPrepareEvent ()
 
QPointF contentPos () const
 
QRectF contentPosRange () const
 
void setContentPos (const QPointF &pos)
 
void setContentPosRange (const QRectF &rect)
 
void setViewportSize (const QSizeF &size)
 
QPointF startPos () const
 
QSizeF viewportSize () 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 QScrollPrepareEvent class is sent in preparation of scrolling. The scroll prepare event is sent before scrolling is started. The object receiving this event should set the viewportSize, contentPos, and contentPosRange properties. It also should accept this event to indicate that scrolling should be started.

It is not guaranteed that a QScrollEvent will be sent after an accepted QScrollPrepareEvent, for example in a case where the maximum content position is (0,0).

See also
QScrollEvent, QScroller

Constructor & Destructor Documentation

QScrollPrepareEvent::QScrollPrepareEvent ( const QPointF startPos)
explicit

Creates a new QScrollPrepareEvent. The startPos is the position of the touch or mouse event that started the scrolling.

QScrollPrepareEvent::~QScrollPrepareEvent ( )

Destroys the QScrollEvent.

Method Documentation

QPointF QScrollPrepareEvent::contentPos ( ) const

Returns the current position of the content.

See also
setContentPos()
QRectF QScrollPrepareEvent::contentPosRange ( ) const

Returns the range of coordinates for the content.

See also
setContentPosRange()
void QScrollPrepareEvent::setContentPos ( const QPointF pos)

Sets the current content position to pos.

See also
contentPos()
void QScrollPrepareEvent::setContentPosRange ( const QRectF rect)

Sets the range of content coordinates to rect.

See also
contentPosRange()
void QScrollPrepareEvent::setViewportSize ( const QSizeF size)

Sets the size of the area that is to be scrolled to size.

See also
viewportSize()
QPointF QScrollPrepareEvent::startPos ( ) const

Returns the position of the touch or mouse event that started the scrolling.

QSizeF QScrollPrepareEvent::viewportSize ( ) const

Returns size of the area that is to be scrolled.

See also
setViewportSize()