Home · All Namespaces · All Classes
Public Slots | Signals | Public Member Functions | Protected Member Functions

PagedViewport Class Reference

PagedViewport creates a view that allows any widget to be panned a set of pages. More...

#include <pagedviewport.h>

Collaboration diagram for PagedViewport:
Collaboration graph
[legend]

List of all members.

Public Slots

void panToPage (uint page)
void setPage (uint page)
void focusFirstPage ()
void stopPanning ()
 Stops the panning by releasing the pointer and stopping physics.

Signals

void pageChanged (int newPage)
void pageCountChanged (int newPageCount)
void pageIsPanning (bool panning)

Public Member Functions

 PagedViewport (QGraphicsItem *parent=0)
virtual ~PagedViewport ()
void setPanDirection (const Qt::Orientations &panDirection)
void updatePageCount (int pages)
 
int currentPage () const
int targetPage () const
float pageWidth () const
void setPageWrapMode (bool enable)

Protected Member Functions

void panGestureEvent (QGestureEvent *event, QPanGesture *panGesture)
 REIMPLEMENTATION

Detailed Description

PagedViewport creates a view that allows any widget to be panned a set of pages.

The PagedViewport extends the MPannableViewport functionality so that it pans the widget inside the viewport through pages. The page within this class refres to the visual appearance only.

The widget inside the MPannableViewport is not split into multiple component or widgets. The PagedViewport only modifies the movement of the MPannableViewport so that the widget being panned appears to consist of multiple pages.

Currently only horizontal paging is supported.


Constructor & Destructor Documentation

PagedViewport::PagedViewport ( QGraphicsItem *  parent = 0  ) 

Constructs a PagedViewport

Parameters:
parent The parent of this viewport
PagedViewport::~PagedViewport (  )  [virtual]

Destroys this PagedViewport


Member Function Documentation

int PagedViewport::currentPage (  )  const

Returns the currently active page

void PagedViewport::focusFirstPage (  )  [slot]

Moves the viewport to the first page

void PagedViewport::pageChanged ( int  newPage  )  [signal]

This signal is sent when ever the page changes inside the viewport. The page change can occur programmatically or with an user interaction

Parameters:
newPage the page that the viewport is currently showing
void PagedViewport::pageCountChanged ( int  newPageCount  )  [signal]

This signal is sent when the page count is changed.

Parameters:
newPage the page new page count
void PagedViewport::pageIsPanning ( bool  panning  )  [signal]

Indicates that a page is panning

Parameters:
panning if true then page is panning, false otherwise
float PagedViewport::pageWidth (  )  const

Returns the page width

void PagedViewport::panGestureEvent ( QGestureEvent *  event,
QPanGesture *  panGesture 
) [protected]

REIMPLEMENTATION

void PagedViewport::panToPage ( uint  page  )  [slot]

Makes the viewport pan to a specific page. If the value exceeds the current amount of pages then the last page is shown.

Parameters:
page The page to pan to
void PagedViewport::setPage ( uint  page  )  [slot]

Moves the viewport to the specified page immediately without animation

Parameters:
page The page to set
void PagedViewport::setPageWrapMode ( bool  enable  ) 

Enables or disables the page wrapping mode. When enabled, the pannable viewport wraps back to the first or the last page when panning over the opposite side.

Parameters:
enable enables or disables the mode
void PagedViewport::setPanDirection ( const Qt::Orientations &  panDirection  ) 

REIMPLEMENTATION Sets pan direction to horizontal regardles of user's wishes. Setting direction to vertical has undetermined effects since it's currently not supported

void PagedViewport::stopPanning (  )  [slot]

Stops the panning by releasing the pointer and stopping physics.

int PagedViewport::targetPage (  )  const

Gets the target page where the panning is going to if there is panning going on. If panning is not going on, then this returns the current page.

void PagedViewport::updatePageCount ( int  pages  ) 

Set the number of pages.

Parameters:
pages The number of pages.

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

Copyright © 2011 Nokia Corporation Generated on Thu Jul 7 2011 22:14:50
Doxygen 1.7.1
MeeGo Touch