• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

KPageView Class Reference

#include <kpageview.h>

Inheritance diagram for KPageView:

Inheritance graph
[legend]

List of all members.


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 );

Author:
Tobias Koenig (tokoe@kde.org)

Definition at line 60 of file kpageview.h.


Public Types

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

Signals

void currentPageChanged (const QModelIndex &current, 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

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.
Enumerator:
Auto 
Plain 
List 
Tree 
Tabbed 

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 300 of file kpageview.cpp.

KPageView::~KPageView (  )  [virtual]

Destroys the page view.

Definition at line 312 of file kpageview.cpp.

KPageView::KPageView ( KPageViewPrivate &  dd,
QWidget *  parent 
) [protected]

Definition at line 306 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 414 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 369 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 385 of file kpageview.cpp.

QAbstractItemModel * KPageView::model (  )  const

Returns the model of the page view.

Definition at line 342 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 360 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 394 of file kpageview.cpp.

void KPageView::setFaceType ( FaceType  faceType  ) 

Sets the face type of the page view.

Definition at line 347 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 378 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 317 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 440 of file kpageview.cpp.

Qt::Alignment KPageView::viewPosition (  )  const [protected, virtual]

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

This method can be reimplemented for adapting custom views.

Definition at line 455 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:
  • kpageview.h
  • kpageview.cpp

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal