# class KPageView

###

Module | kdeui
Namespace |
Class | KPageView
Inherits | QWidget

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:\n

    KPageModel *model = new MyPageModel();

    KPageView *view = new KPageView( this );
    view->setModel( model );

    view->setFaceType( KPageView.List );

Author Tobias Koenig (tokoe@kde.org)

### enums

- FaceType { Auto, Plain, List, Tree, Tabbed }

enum details

### methods

- KPageView (parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  parent | QWidget | 0

  Creates a page view with given parent.

- KPageView (dd, parent)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  dd | KPageViewPrivate |
  parent | QWidget |

- KPageView (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QWidget | 0

- createView ( )

  returns QAbstractItemView

  Returns the navigation view, depending on the current face type.

  This method can be reimplemented to provide custom navigation views.

- currentPage ( )

  returns QModelIndex

  Returns the index for the current page or an invalid index if no current page exists.

- currentPageChanged (current, previous)

  returns Nothing
  SIGNAL ("currentPageChanged (const QModelIndex&, const QModelIndex&)")

  Argument | Type | Default
  --- | --- | ---
  current | QModelIndex |
  previous | QModelIndex |

  This signal is emitted whenever the current page changes. The previous page index is replaced by the current index.

- faceType ( )

  returns KPageView.FaceType

  Returns the face type of the page view.

- itemDelegate ( )

  returns QAbstractItemDelegate

  Returns the item delegate of the page view.

- model ( )

  returns QAbstractItemModel

  Returns the model of the page view.

- setCurrentPage (index)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  index | QModelIndex |

  Sets the page with index - to be the current page and emits the

  See also currentPageChanged signal.

- setDefaultWidget (widget)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  widget | QWidget |

  Sets the widget which will be shown when a page is selected that has no own widget set.

- setFaceType (faceType)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  faceType | KPageView.FaceType |

  Sets the face type of the page view.

- setItemDelegate (delegate)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  delegate | QAbstractItemDelegate |

  Sets the item delegate - which can be used customize the page view.

- setModel (model)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  model | QAbstractItemModel |

  Sets the model of the page view.

  The model has to provide data for the roles defined in KPageModel.Role.

- showPageHeader ( )

  returns bool

  Returns whether the page header should be visible.

  This method can be reimplemented for adapting custom views.

- viewPosition ( )

  returns Qt.Alignment

  Returns the position where the navigation view should be located according the page stack.

  This method can be reimplemented for adapting custom views.

### enums - detail

- FaceType { Auto, Plain, List, Tree, Tabbed }

  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.

| Auto | - | - |
| Plain | - | - |
| List | - | - |
| Tree | - | - |
| Tabbed | - | - |