QtGui/qidentityproxymodel.h Source File

qidentityproxymodel.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 
43 #ifndef QIDENTITYPROXYMODEL_H
44 #define QIDENTITYPROXYMODEL_H
45 
47 
48 #ifndef QT_NO_IDENTITYPROXYMODEL
49 
51 
53 
54 QT_MODULE(Gui)
55 
56 class QIdentityProxyModelPrivate;
57 
58 class Q_GUI_EXPORT QIdentityProxyModel : public QAbstractProxyModel
59 {
60  Q_OBJECT
61 public:
62  explicit QIdentityProxyModel(QObject* parent = 0);
64 
65  int columnCount(const QModelIndex& parent = QModelIndex()) const;
66  QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const;
67  QModelIndex mapFromSource(const QModelIndex& sourceIndex) const;
68  QModelIndex mapToSource(const QModelIndex& proxyIndex) const;
69  QModelIndex parent(const QModelIndex& child) const;
70  int rowCount(const QModelIndex& parent = QModelIndex()) const;
71  bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent);
72 
73  QItemSelection mapSelectionFromSource(const QItemSelection& selection) const;
74  QItemSelection mapSelectionToSource(const QItemSelection& selection) const;
75  QModelIndexList match(const QModelIndex& start, int role, const QVariant& value, int hits = 1, Qt::MatchFlags flags = Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const;
76  void setSourceModel(QAbstractItemModel* sourceModel);
77 
78  bool insertColumns(int column, int count, const QModelIndex& parent = QModelIndex());
79  bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex());
80  bool removeColumns(int column, int count, const QModelIndex& parent = QModelIndex());
81  bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex());
82 
83 protected:
84  QIdentityProxyModel(QIdentityProxyModelPrivate &dd, QObject* parent);
85 
86 private:
87  Q_DECLARE_PRIVATE(QIdentityProxyModel)
88  Q_DISABLE_COPY(QIdentityProxyModel)
89 
90  Q_PRIVATE_SLOT(d_func(), void _q_sourceRowsAboutToBeInserted(QModelIndex,int,int))
91  Q_PRIVATE_SLOT(d_func(), void _q_sourceRowsInserted(QModelIndex,int,int))
92  Q_PRIVATE_SLOT(d_func(), void _q_sourceRowsAboutToBeRemoved(QModelIndex,int,int))
93  Q_PRIVATE_SLOT(d_func(), void _q_sourceRowsRemoved(QModelIndex,int,int))
94  Q_PRIVATE_SLOT(d_func(), void _q_sourceRowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int))
95  Q_PRIVATE_SLOT(d_func(), void _q_sourceRowsMoved(QModelIndex,int,int,QModelIndex,int))
96 
97  Q_PRIVATE_SLOT(d_func(), void _q_sourceColumnsAboutToBeInserted(QModelIndex,int,int))
98  Q_PRIVATE_SLOT(d_func(), void _q_sourceColumnsInserted(QModelIndex,int,int))
99  Q_PRIVATE_SLOT(d_func(), void _q_sourceColumnsAboutToBeRemoved(QModelIndex,int,int))
100  Q_PRIVATE_SLOT(d_func(), void _q_sourceColumnsRemoved(QModelIndex,int,int))
101  Q_PRIVATE_SLOT(d_func(), void _q_sourceColumnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int))
102  Q_PRIVATE_SLOT(d_func(), void _q_sourceColumnsMoved(QModelIndex,int,int,QModelIndex,int))
103 
104  Q_PRIVATE_SLOT(d_func(), void _q_sourceDataChanged(QModelIndex,QModelIndex))
105  Q_PRIVATE_SLOT(d_func(), void _q_sourceHeaderDataChanged(Qt::Orientation orientation, int first, int last))
106 
107  Q_PRIVATE_SLOT(d_func(), void _q_sourceLayoutAboutToBeChanged())
108  Q_PRIVATE_SLOT(d_func(), void _q_sourceLayoutChanged())
109  Q_PRIVATE_SLOT(d_func(), void _q_sourceModelAboutToBeReset())
110  Q_PRIVATE_SLOT(d_func(), void _q_sourceModelReset())
111 };
112 
114 
116 
117 #endif // QT_NO_IDENTITYPROXYMODEL
118 
119 #endif // QIDENTITYPROXYMODEL_H
120 
#define QT_END_NAMESPACE
Definition: qglobal.h:128
GLuint start
Definition: GLee.h:872
#define QT_BEGIN_HEADER
Definition: qglobal.h:141
#define Q_PRIVATE_SLOT(d, signature)
Definition: qobjectdefs.h:73
GLenum GLenum GLvoid * row
Definition: GLee.h:893
#define QT_BEGIN_NAMESPACE
Definition: qglobal.h:127
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: GLee.h:880
GLint * first
Definition: GLee.h:1362
GLuint GLuint GLsizei count
Definition: GLee.h:872
Orientation
Definition: qnamespace.h:174
DropAction
Definition: qnamespace.h:1597
#define Q_OBJECT
Definition: qobjectdefs.h:157
GLsizei const GLfloat * value
Definition: GLee.h:1742
GLenum GLenum GLvoid GLvoid * column
Definition: GLee.h:893
#define QT_END_HEADER
Definition: qglobal.h:142
GLuint index
Definition: GLee.h:1704