KDEUI
kpageview.h
Go to the documentation of this file.
00001 /* 00002 This file is part of the KDE Libraries 00003 00004 Copyright (C) 2006 Tobias Koenig (tokoe@kde.org) 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef KPAGEVIEW_H 00023 #define KPAGEVIEW_H 00024 00025 #include <kdeui_export.h> 00026 00027 #include <QtGui/QWidget> 00028 00029 class KPageModel; 00030 00031 class QAbstractItemDelegate; 00032 class QAbstractItemView; 00033 class QModelIndex; 00034 class KPageViewPrivate; 00035 class QAbstractItemModel; 00036 00060 class KDEUI_EXPORT KPageView : public QWidget 00061 { 00062 Q_OBJECT 00063 Q_ENUMS( FaceType ) 00064 Q_PROPERTY( FaceType faceType READ faceType WRITE setFaceType ) 00065 Q_DECLARE_PRIVATE(KPageView) 00066 00067 public: 00085 enum FaceType 00086 { 00087 Auto, 00088 Plain, 00089 List, 00090 Tree, 00091 Tabbed 00092 }; 00093 00097 explicit KPageView( QWidget *parent = 0 ); 00098 00102 virtual ~KPageView(); 00103 00109 void setModel(QAbstractItemModel *model); 00110 00114 QAbstractItemModel* model() const; 00115 00119 void setFaceType( FaceType faceType ); 00120 00124 FaceType faceType() const; 00125 00130 void setCurrentPage( const QModelIndex &index ); 00131 00136 QModelIndex currentPage() const; 00137 00142 void setItemDelegate( QAbstractItemDelegate *delegate ); 00143 00147 QAbstractItemDelegate* itemDelegate() const; 00148 00153 void setDefaultWidget( QWidget *widget ); 00154 00155 Q_SIGNALS: 00160 void currentPageChanged( const QModelIndex ¤t, const QModelIndex &previous ); 00161 00162 protected: 00170 virtual QAbstractItemView* createView(); 00171 00178 virtual bool showPageHeader() const; 00179 00187 virtual Qt::Alignment viewPosition() const; 00188 00189 KPageView(KPageViewPrivate &dd, QWidget *parent); 00190 KPageViewPrivate *const d_ptr; 00191 00192 private: 00193 Q_PRIVATE_SLOT(d_func(), void _k_rebuildGui()) 00194 Q_PRIVATE_SLOT(d_func(), void _k_modelChanged()) 00195 Q_PRIVATE_SLOT(d_func(), void _k_pageSelected(const QItemSelection &, const QItemSelection &)) 00196 Q_PRIVATE_SLOT(d_func(), void _k_dataChanged(const QModelIndex &, const QModelIndex &)) 00197 }; 00198 00199 #endif
KDE 4.6 API Reference