2
This file is part of the KDE Libraries
4
Copyright (C) 2006 Tobias Koenig (tokoe@kde.org)
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Library General Public
8
License as published by the Free Software Foundation; either
9
version 2 of the License, or (at your option) any later version.
11
This library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Library General Public License for more details.
16
You should have received a copy of the GNU Library General Public License
17
along with this library; see the file COPYING.LIB. If not, write to
18
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19
Boston, MA 02110-1301, USA.
25
#include <QtCore/QAbstractItemModel>
27
#include <kdelibs_export.h>
30
* @short A base class for a model used by KPageView.
32
* This class is an abstract base class which must be used to
33
* implement custom models for KPageView. Additional to the the standard
34
* Qt::ItemDataRoles it provides the two roles
39
* which are used to return a header string for a page and a QWidget
40
* pointer to the page itself.
45
* KPageView *view = new KPageView( this );
46
* KPageModel *model = new MyPageModel( this );
48
* view->setModel( model );
52
* @author Tobias Koenig <tokoe@kde.org>
54
class KDEUI_EXPORT KPageModel : public QAbstractItemModel
60
* Additional KPageModel specific roles.
62
* @li HeaderRole - The data to be rendered as page header (usually text).
63
* @li WidgetRole - The data which contains a pointer to the page widget.
67
HeaderRole = Qt::UserRole + 1,
72
* Constructs a page model with the given parent.
74
explicit KPageModel( QObject *parent = 0 );
77
* Destroys the page model.
79
virtual ~KPageModel();