KDEUI
KPageView Class Reference
A base class which can handle multiple pages. More...
#include <kpageview.h>

Public Types | |
enum | FaceType { Auto, Plain, List, Tree, Tabbed } |
Signals | |
void | currentPageChanged (const QModelIndex ¤t, const QModelIndex &previous) |
Public Member Functions | |
QModelIndex | currentPage () const |
FaceType | faceType () const |
QAbstractItemDelegate * | itemDelegate () const |
KPageView (QWidget *parent=0) | |
QAbstractItemModel * | model () const |
void | setCurrentPage (const QModelIndex &index) |
void | setDefaultWidget (QWidget *widget) |
void | setFaceType (FaceType faceType) |
void | setItemDelegate (QAbstractItemDelegate *delegate) |
void | setModel (QAbstractItemModel *model) |
virtual | ~KPageView () |
Protected Member Functions | |
virtual QAbstractItemView * | createView () |
KPageView (KPageViewPrivate &dd, QWidget *parent) | |
virtual bool | showPageHeader () const |
virtual Qt::Alignment | viewPosition () const |
Protected Attributes | |
KPageViewPrivate *const | d_ptr |
Properties | |
FaceType | faceType |
Detailed Description
A base class which can handle multiple pages.
This class provides a widget base class which handles multiple pages and allows the user to switch between these pages in different ways.
Currently, Auto
, Plain
, List
, Tree
and Tabbed
face types are available.
- See also:
- KPageWidget
Example:
KPageModel *model = new MyPageModel(); KPageView *view = new KPageView( this ); view->setModel( model ); view->setFaceType( KPageView::List );
Definition at line 60 of file kpageview.h.
Member Enumeration Documentation
enum KPageView::FaceType |
This enum is used to decide which type of navigation view shall be used in the page view.
- Auto - Depending on the number of pages in the model, the Plain (one page), the List (several pages) or the Tree face (nested pages) will be used. This is the default face type.
- Plain - No navigation view will be visible and only the first page of the model will be shown.
- List - An icon list is used as navigation view.
- Tree - A tree list is used as navigation view.
- Tabbed - A tab widget is used as navigation view.
Definition at line 85 of file kpageview.h.
Constructor & Destructor Documentation
KPageView::KPageView | ( | QWidget * | parent = 0 |
) | [explicit] |
Creates a page view with given parent.
KPageView Implementation.
Definition at line 299 of file kpageview.cpp.
KPageView::~KPageView | ( | ) | [virtual] |
Destroys the page view.
Definition at line 311 of file kpageview.cpp.
KPageView::KPageView | ( | KPageViewPrivate & | dd, | |
QWidget * | parent | |||
) | [protected] |
Definition at line 305 of file kpageview.cpp.
Member Function Documentation
QAbstractItemView * KPageView::createView | ( | ) | [protected, virtual] |
Returns the navigation view, depending on the current face type.
This method can be reimplemented to provide custom navigation views.
Definition at line 413 of file kpageview.cpp.
QModelIndex KPageView::currentPage | ( | ) | const |
Returns the index for the current page or an invalid index if no current page exists.
Reimplemented in KPageWidget.
Definition at line 368 of file kpageview.cpp.
void KPageView::currentPageChanged | ( | const QModelIndex & | current, | |
const QModelIndex & | previous | |||
) | [signal] |
This signal is emitted whenever the current page changes.
The previous page index is replaced by the current index.
FaceType KPageView::faceType | ( | ) | const |
Returns the face type of the page view.
QAbstractItemDelegate * KPageView::itemDelegate | ( | ) | const |
Returns the item delegate of the page view.
Definition at line 384 of file kpageview.cpp.
QAbstractItemModel * KPageView::model | ( | ) | const |
Returns the model of the page view.
Definition at line 341 of file kpageview.cpp.
void KPageView::setCurrentPage | ( | const QModelIndex & | index | ) |
Sets the page with.
- Parameters:
-
index to be the current page and emits the
- See also:
- currentPageChanged signal.
Definition at line 359 of file kpageview.cpp.
void KPageView::setDefaultWidget | ( | QWidget * | widget | ) |
Sets the widget
which will be shown when a page is selected that has no own widget set.
Definition at line 393 of file kpageview.cpp.
void KPageView::setFaceType | ( | FaceType | faceType | ) |
Sets the face type of the page view.
Definition at line 346 of file kpageview.cpp.
void KPageView::setItemDelegate | ( | QAbstractItemDelegate * | delegate | ) |
Sets the item.
- Parameters:
-
delegate which can be used customize the page view.
Definition at line 377 of file kpageview.cpp.
void KPageView::setModel | ( | QAbstractItemModel * | model | ) |
Sets the model
of the page view.
The model has to provide data for the roles defined in KPageModel::Role.
Definition at line 316 of file kpageview.cpp.
bool KPageView::showPageHeader | ( | ) | const [protected, virtual] |
Returns whether the page header should be visible.
This method can be reimplemented for adapting custom views.
Definition at line 439 of file kpageview.cpp.
Qt::Alignment KPageView::viewPosition | ( | ) | const [protected, virtual] |
Returns the position where the navigation view should be located according to the page stack.
This method can be reimplemented for adapting custom views.
Definition at line 454 of file kpageview.cpp.
Member Data Documentation
KPageViewPrivate* const KPageView::d_ptr [protected] |
Definition at line 190 of file kpageview.h.
Property Documentation
KPageView::FaceType KPageView::faceType [read, write] |
Definition at line 64 of file kpageview.h.
The documentation for this class was generated from the following files: