1 | /**************************************************************************** |
2 | ** |
3 | ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). |
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 | #ifndef QHEADERVIEW_H |
43 | #define QHEADERVIEW_H |
44 | |
45 | #include <QtGui/qabstractitemview.h> |
46 | |
47 | QT_BEGIN_HEADER |
48 | |
49 | QT_BEGIN_NAMESPACE |
50 | |
51 | QT_MODULE(Gui) |
52 | |
53 | #ifndef QT_NO_ITEMVIEWS |
54 | |
55 | class ; |
56 | class ; |
57 | |
58 | class Q_GUI_EXPORT : public QAbstractItemView |
59 | { |
60 | Q_OBJECT |
61 | Q_PROPERTY(bool showSortIndicator READ isSortIndicatorShown WRITE setSortIndicatorShown) |
62 | Q_PROPERTY(bool highlightSections READ highlightSections WRITE setHighlightSections) |
63 | Q_PROPERTY(bool stretchLastSection READ stretchLastSection WRITE setStretchLastSection) |
64 | Q_PROPERTY(bool cascadingSectionResizes READ cascadingSectionResizes WRITE setCascadingSectionResizes) |
65 | Q_PROPERTY(int defaultSectionSize READ defaultSectionSize WRITE setDefaultSectionSize) |
66 | Q_PROPERTY(int minimumSectionSize READ minimumSectionSize WRITE setMinimumSectionSize) |
67 | Q_PROPERTY(Qt::Alignment defaultAlignment READ defaultAlignment WRITE setDefaultAlignment) |
68 | Q_ENUMS(ResizeMode) |
69 | |
70 | public: |
71 | |
72 | enum |
73 | { |
74 | , |
75 | , |
76 | , |
77 | , |
78 | = Fixed |
79 | }; |
80 | |
81 | explicit (Qt::Orientation orientation, QWidget *parent = 0); |
82 | virtual (); |
83 | |
84 | void (QAbstractItemModel *model); |
85 | |
86 | Qt::Orientation () const; |
87 | int () const; |
88 | int () const; |
89 | QSize () const; |
90 | int (int logicalIndex) const; |
91 | |
92 | int (int position) const; |
93 | int (int position) const; |
94 | |
95 | inline int logicalIndexAt(int x, int y) const; |
96 | inline int logicalIndexAt(const QPoint &pos) const; |
97 | |
98 | int (int logicalIndex) const; |
99 | int (int logicalIndex) const; |
100 | int (int logicalIndex) const; |
101 | |
102 | void (int from, int to); |
103 | void (int first, int second); |
104 | void (int logicalIndex, int size); |
105 | void (QHeaderView::ResizeMode mode); |
106 | |
107 | bool (int logicalIndex) const; |
108 | void (int logicalIndex, bool hide); |
109 | int () const; |
110 | |
111 | inline void hideSection(int logicalIndex); |
112 | inline void showSection(int logicalIndex); |
113 | |
114 | int () const; |
115 | int (int logicalIndex) const; |
116 | int (int visualIndex) const; |
117 | |
118 | void (bool movable); |
119 | bool () const; |
120 | |
121 | void (bool clickable); |
122 | bool () const; |
123 | |
124 | void (bool highlight); |
125 | bool () const; |
126 | |
127 | void (ResizeMode mode); |
128 | void (int logicalIndex, ResizeMode mode); |
129 | ResizeMode (int logicalIndex) const; |
130 | int () const; |
131 | |
132 | void (bool show); |
133 | bool () const; |
134 | |
135 | void (int logicalIndex, Qt::SortOrder order); |
136 | int () const; |
137 | Qt::SortOrder () const; |
138 | |
139 | bool () const; |
140 | void (bool stretch); |
141 | |
142 | bool () const; |
143 | void (bool enable); |
144 | |
145 | int () const; |
146 | void (int size); |
147 | |
148 | int () const; |
149 | void (int size); |
150 | |
151 | Qt::Alignment () const; |
152 | void (Qt::Alignment alignment); |
153 | |
154 | void (); |
155 | bool () const; |
156 | bool () const; |
157 | |
158 | #ifndef QT_NO_DATASTREAM |
159 | QByteArray () const; |
160 | bool (const QByteArray &state); |
161 | #endif |
162 | |
163 | void (); |
164 | |
165 | public Q_SLOTS: |
166 | void (int offset); |
167 | void (int visualIndex); |
168 | void (); |
169 | void (Qt::Orientation orientation, int logicalFirst, int logicalLast); |
170 | |
171 | Q_SIGNALS: |
172 | void (int logicalIndex, int oldVisualIndex, int newVisualIndex); |
173 | void (int logicalIndex, int oldSize, int newSize); |
174 | void (int logicalIndex); |
175 | void (int logicalIndex); |
176 | void (int logicalIndex); |
177 | void (int logicalIndex); |
178 | void (int oldCount, int newCount); |
179 | void sectionHandleDoubleClicked(int logicalIndex); |
180 | void (int logicalIndex, QHeaderView::ResizeMode mode); |
181 | void (); |
182 | void (int logicalIndex, Qt::SortOrder order); |
183 | |
184 | protected Q_SLOTS: |
185 | void (int logicalIndex); |
186 | void (); |
187 | void (const QModelIndex &parent, int logicalFirst, int logicalLast); |
188 | void (const QModelIndex &parent, int logicalFirst, int logicalLast); |
189 | |
190 | protected: |
191 | (QHeaderViewPrivate &dd, Qt::Orientation orientation, QWidget *parent = 0); |
192 | void (); |
193 | |
194 | void (); |
195 | void (int start, int end); |
196 | void (const QModelIndex ¤t, const QModelIndex &old); |
197 | |
198 | bool (QEvent *e); |
199 | void (QPaintEvent *e); |
200 | void (QMouseEvent *e); |
201 | void (QMouseEvent *e); |
202 | void (QMouseEvent *e); |
203 | void (QMouseEvent *e); |
204 | bool (QEvent *e); |
205 | |
206 | virtual void (QPainter *painter, const QRect &rect, int logicalIndex) const; |
207 | virtual QSize (int logicalIndex) const; |
208 | |
209 | int () const; |
210 | int () const; |
211 | void (); |
212 | void (int dx, int dy); |
213 | |
214 | void (const QModelIndex &topLeft, const QModelIndex &bottomRight); |
215 | void (const QModelIndex &parent, int start, int end); |
216 | |
217 | QRect (const QModelIndex &index) const; |
218 | void (const QModelIndex &index, ScrollHint hint); |
219 | |
220 | QModelIndex (const QPoint &p) const; |
221 | bool (const QModelIndex &index) const; |
222 | |
223 | QModelIndex (CursorAction, Qt::KeyboardModifiers); |
224 | void (const QRect& rect, QItemSelectionModel::SelectionFlags flags); |
225 | QRegion (const QItemSelection &selection) const; |
226 | void (QStyleOptionHeader *option) const; |
227 | |
228 | private: |
229 | Q_PRIVATE_SLOT(d_func(), void _q_sectionsRemoved(const QModelIndex &parent, int logicalFirst, int logicalLast)) |
230 | Q_PRIVATE_SLOT(d_func(), void _q_layoutAboutToBeChanged()) |
231 | Q_DECLARE_PRIVATE(QHeaderView) |
232 | Q_DISABLE_COPY() |
233 | }; |
234 | |
235 | inline int QHeaderView::(int ax, int ay) const |
236 | { return orientation() == Qt::Horizontal ? logicalIndexAt(ax) : logicalIndexAt(ay); } |
237 | inline int QHeaderView::(const QPoint &apos) const |
238 | { return logicalIndexAt(apos.x(), apos.y()); } |
239 | inline void QHeaderView::(int alogicalIndex) |
240 | { setSectionHidden(alogicalIndex, true); } |
241 | inline void QHeaderView::(int alogicalIndex) |
242 | { setSectionHidden(alogicalIndex, false); } |
243 | |
244 | #endif // QT_NO_ITEMVIEWS |
245 | |
246 | QT_END_NAMESPACE |
247 | |
248 | QT_END_HEADER |
249 | |
250 | #endif // QHEADERVIEW_H |
251 | |