Qt 4.8
qlistview_p.h
Go to the documentation of this file.
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 QLISTVIEW_P_H
43 #define QLISTVIEW_P_H
44 
45 //
46 // W A R N I N G
47 // -------------
48 //
49 // This file is not part of the Qt API. It exists for the convenience
50 // of other Qt classes. This header file may change from version to
51 // version without notice, or even be removed.
52 //
53 // We mean it.
54 //
55 
56 #include "private/qabstractitemview_p.h"
57 #include "qrubberband.h"
58 #include "qbitarray.h"
59 #include "qbsptree_p.h"
60 #include <limits.h>
61 #include <qscrollbar.h>
62 
63 #ifndef QT_NO_LISTVIEW
64 
66 
68 {
69  friend class QListViewPrivate;
70  friend class QListModeViewBase;
71  friend class QIconModeViewBase;
72 public:
73  inline QListViewItem()
74  : x(-1), y(-1), w(0), h(0), indexHint(-1), visited(0xffff) {}
75  inline QListViewItem(const QListViewItem &other)
76  : x(other.x), y(other.y), w(other.w), h(other.h),
77  indexHint(other.indexHint), visited(other.visited) {}
78  inline QListViewItem(QRect r, int i)
79  : x(r.x()), y(r.y()), w(qMin(r.width(), SHRT_MAX)), h(qMin(r.height(), SHRT_MAX)),
80  indexHint(i), visited(0xffff) {}
81  inline bool operator==(const QListViewItem &other) const {
82  return (x == other.x && y == other.y && w == other.w && h == other.h &&
83  indexHint == other.indexHint); }
84  inline bool operator!=(const QListViewItem &other) const
85  { return !(*this == other); }
86  inline bool isValid() const
87  { return rect().isValid() && (indexHint > -1); }
88  inline void invalidate()
89  { x = -1; y = -1; w = 0; h = 0; }
90  inline void resize(const QSize &size)
91  { w = qMin(size.width(), SHRT_MAX); h = qMin(size.height(), SHRT_MAX); }
92  inline void move(const QPoint &position)
93  { x = position.x(); y = position.y(); }
94  inline int width() const { return w; }
95  inline int height() const { return h; }
96 private:
97  inline QRect rect() const
98  { return QRect(x, y, w, h); }
99  int x, y;
100  short w, h;
101  mutable int indexHint;
103 };
104 
106 {
109  int spacing;
110  int first;
111  int last;
112  bool wrap;
114  int max;
115 };
116 
117 class QListView;
118 class QListViewPrivate;
119 
121 {
122 public:
123  inline QCommonListViewBase(QListView *q, QListViewPrivate *d) : dd(d), qq(q), batchStartRow(0), batchSavedDeltaSeg(0) {}
124  virtual ~QCommonListViewBase() {}
125 
126  //common interface
127  virtual int itemIndex(const QListViewItem &item) const = 0;
128  virtual QListViewItem indexToListViewItem(const QModelIndex &index) const = 0;
129  virtual bool doBatchedItemLayout(const QListViewLayoutInfo &info, int max) = 0;
130  virtual void clear() = 0;
131  virtual void setRowCount(int) = 0;
132  virtual QVector<QModelIndex> intersectingSet(const QRect &area) const = 0;
133  virtual void dataChanged(const QModelIndex &, const QModelIndex &) = 0;
134 
135  virtual int horizontalScrollToValue(int index, QListView::ScrollHint hint,
136  bool leftOf, bool rightOf, const QRect &area, const QRect &rect) const;
137  virtual int verticalScrollToValue(int index, QListView::ScrollHint hint,
138  bool above, bool below, const QRect &area, const QRect &rect) const;
139  virtual void scrollContentsBy(int dx, int dy, bool scrollElasticBand);
140  virtual QRect mapToViewport(const QRect &rect) const {return rect;}
141  virtual int horizontalOffset() const;
142  virtual int verticalOffset() const { return verticalScrollBar()->value(); }
143  virtual void updateHorizontalScrollBar(const QSize &step);
144  virtual void updateVerticalScrollBar(const QSize &step);
145  virtual void appendHiddenRow(int row);
146  virtual void removeHiddenRow(int row);
147  virtual void setPositionForIndex(const QPoint &, const QModelIndex &) { }
148 
149 #ifndef QT_NO_DRAGANDDROP
150  void paintDragDrop(QPainter *painter);
151  virtual bool filterDragMoveEvent(QDragMoveEvent *) { return false; }
152  virtual bool filterDragLeaveEvent(QDragLeaveEvent *) { return false; }
153  virtual bool filterDropEvent(QDropEvent *) { return false; }
154  virtual bool filterStartDrag(Qt::DropActions) { return false; }
155 #endif
156 
157 
158  //other inline members
159  inline int spacing() const;
160  inline bool isWrapping() const;
161  inline QSize gridSize() const;
162  inline QListView::Flow flow() const;
163  inline QListView::Movement movement() const;
164 
165  inline QPoint offset() const;
166  inline QPoint pressedPosition() const;
167  inline bool uniformItemSizes() const;
168  inline int column() const;
169 
170  inline QScrollBar *verticalScrollBar() const;
171  inline QScrollBar *horizontalScrollBar() const;
172  inline QListView::ScrollMode verticalScrollMode() const;
173  inline QListView::ScrollMode horizontalScrollMode() const;
174 
175  inline QModelIndex modelIndex(int row) const;
176  inline int rowCount() const;
177 
178  inline QStyleOptionViewItemV4 viewOptions() const;
179  inline QWidget *viewport() const;
180  inline QRect clipRect() const;
181 
182  inline QSize cachedItemSize() const;
183  inline QRect viewItemRect(const QListViewItem &item) const;
184  inline QSize itemSize(const QStyleOptionViewItemV2 &opt, const QModelIndex &idx) const;
185  inline QAbstractItemDelegate *delegate(const QModelIndex &idx) const;
186 
187  inline bool isHidden(int row) const;
188  inline int hiddenCount() const;
189 
190  inline bool isRightToLeft() const;
191 
197 };
198 
200 {
201 public:
203 
209 
210  // used when laying out in batches
212 
213  //reimplementations
214  int itemIndex(const QListViewItem &item) const { return item.indexHint; }
215  QListViewItem indexToListViewItem(const QModelIndex &index) const;
216  bool doBatchedItemLayout(const QListViewLayoutInfo &info, int max);
217  void clear();
218  void setRowCount(int rowCount) { flowPositions.resize(rowCount); }
219  QVector<QModelIndex> intersectingSet(const QRect &area) const;
220  void dataChanged(const QModelIndex &, const QModelIndex &);
221 
222  int horizontalScrollToValue(int index, QListView::ScrollHint hint,
223  bool leftOf, bool rightOf,const QRect &area, const QRect &rect) const;
224  int verticalScrollToValue(int index, QListView::ScrollHint hint,
225  bool above, bool below, const QRect &area, const QRect &rect) const;
226  void scrollContentsBy(int dx, int dy, bool scrollElasticBand);
227  QRect mapToViewport(const QRect &rect) const;
228  int horizontalOffset() const;
229  int verticalOffset() const;
230  void updateHorizontalScrollBar(const QSize &step);
231  void updateVerticalScrollBar(const QSize &step);
232 
233 #ifndef QT_NO_DRAGANDDROP
234  // The next two methods are to be used on LefToRight flow only.
235  // WARNING: Plenty of duplicated code from QAbstractItemView{,Private}.
236  QAbstractItemView::DropIndicatorPosition position(const QPoint &pos, const QRect &rect, const QModelIndex &idx) const;
237  void dragMoveEvent(QDragMoveEvent *e);
238  bool dropOn(QDropEvent *event, int *row, int *col, QModelIndex *index);
239 #endif
240 
241 private:
242  QPoint initStaticLayout(const QListViewLayoutInfo &info);
243  void doStaticLayout(const QListViewLayoutInfo &info);
244  int perItemScrollToValue(int index, int value, int height,
246  Qt::Orientation orientation, bool wrap, int extent) const;
247  int perItemScrollingPageSteps(int length, int bounds, bool wrap) const;
248 };
249 
251 {
252 public:
253  QIconModeViewBase(QListView *q, QListViewPrivate *d) : QCommonListViewBase(q, d), interSectingVector(0) {}
254 
258 
259  QVector<QModelIndex> draggedItems; // indices to the tree.itemVector
261 
262  // used when laying out in batches
263  QVector<QModelIndex> *interSectingVector; //used from within intersectingSet
264 
265  //reimplementations
266  int itemIndex(const QListViewItem &item) const;
267  QListViewItem indexToListViewItem(const QModelIndex &index) const;
268  bool doBatchedItemLayout(const QListViewLayoutInfo &info, int max);
269  void clear();
270  void setRowCount(int rowCount);
271  QVector<QModelIndex> intersectingSet(const QRect &area) const;
272 
273  void scrollContentsBy(int dx, int dy, bool scrollElasticBand);
274  void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
275  void appendHiddenRow(int row);
276  void removeHiddenRow(int row);
277  void setPositionForIndex(const QPoint &position, const QModelIndex &index);
278 
279 #ifndef QT_NO_DRAGANDDROP
280  bool filterDragMoveEvent(QDragMoveEvent *);
281  bool filterDragLeaveEvent(QDragLeaveEvent *);
282  bool filterDropEvent(QDropEvent *e);
283  bool filterStartDrag(Qt::DropActions);
284 #endif
285 
286 private:
287  void initBspTree(const QSize &contents);
288  QPoint initDynamicLayout(const QListViewLayoutInfo &info);
289  void doDynamicLayout(const QListViewLayoutInfo &info);
290  static void addLeaf(QVector<int> &leaf, const QRect &area,
292  QRect itemsRect(const QVector<QModelIndex> &indexes) const;
293  QRect draggedItemsRect() const;
294  QPoint snapToGrid(const QPoint &pos) const;
295  void updateContentsSize();
296  QPoint draggedItemsDelta() const;
297  void drawItems(QPainter *painter, const QVector<QModelIndex> &indexes) const;
298  void moveItem(int index, const QPoint &dest);
299 
300 };
301 
303 {
305 public:
307  ~QListViewPrivate();
308 
309  void clear();
310  void prepareItemsLayout();
311 
312  bool doItemsLayout(int num);
313 
314  inline QVector<QModelIndex> intersectingSet(const QRect &area, bool doLayout = true) const {
315  if (doLayout) executePostedLayout();
316  QRect a = (q_func()->isRightToLeft() ? flipX(area.normalized()) : area.normalized());
317  return commonListView->intersectingSet(a);
318  }
319 
320  inline void resetBatchStartRow() { commonListView->batchStartRow = 0; }
321  inline int batchStartRow() const { return commonListView->batchStartRow; }
322  inline QSize contentsSize() const { return commonListView->contentsSize; }
323  inline void setContentsSize(int w, int h) { commonListView->contentsSize = QSize(w, h); }
324 
325  inline int flipX(int x) const
326  { return qMax(viewport->width(), contentsSize().width()) - x; }
327  inline QPoint flipX(const QPoint &p) const
328  { return QPoint(flipX(p.x()), p.y()); }
329  inline QRect flipX(const QRect &r) const
330  { return QRect(flipX(r.x()) - r.width(), r.y(), r.width(), r.height()); }
331  inline QRect viewItemRect(const QListViewItem &item) const
332  { if (q_func()->isRightToLeft()) return flipX(item.rect()); return item.rect(); }
333 
334  QListViewItem indexToListViewItem(const QModelIndex &index) const;
336  { return model->index(commonListView->itemIndex(item), column, root); }
337 
338  QRect rectForIndex(const QModelIndex &index) const
339  {
340  if (!isIndexValid(index) || index.parent() != root || index.column() != column || isHidden(index.row()))
341  return QRect();
342  executePostedLayout();
343  return viewItemRect(indexToListViewItem(index));
344  }
345 
346  void viewUpdateGeometries() { q_func()->updateGeometries(); }
347 
348 
349  QRect mapToViewport(const QRect &rect, bool extend = true) const;
350 
351  QModelIndex closestIndex(const QRect &target, const QVector<QModelIndex> &candidates) const;
352  QSize itemSize(const QStyleOptionViewItem &option, const QModelIndex &index) const;
353 
354  bool selectionAllowed(const QModelIndex &index) const
355  { if (viewMode == QListView::ListMode && !showElasticBand) return index.isValid(); return true; }
356 
357  int horizontalScrollToValue(const QModelIndex &index, const QRect &rect, QListView::ScrollHint hint) const;
358  int verticalScrollToValue(const QModelIndex &index, const QRect &rect, QListView::ScrollHint hint) const;
359 
360  QItemSelection selection(const QRect &rect) const;
361  void selectAll(QItemSelectionModel::SelectionFlags command);
362 
363 #ifndef QT_NO_DRAGANDDROP
364  virtual QAbstractItemView::DropIndicatorPosition position(const QPoint &pos, const QRect &rect, const QModelIndex &idx) const;
365  bool dropOn(QDropEvent *event, int *row, int *col, QModelIndex *index);
366 #endif
367 
368  inline void setGridSize(const QSize &size) { grid = size; }
369  inline QSize gridSize() const { return grid; }
370  inline void setWrapping(bool b) { wrap = b; }
371  inline bool isWrapping() const { return wrap; }
372  inline void setSpacing(int s) { space = s; }
373  inline int spacing() const { return space; }
374  inline void setSelectionRectVisible(bool visible) { showElasticBand = visible; }
375  inline bool isSelectionRectVisible() const { return showElasticBand; }
376 
377  inline QModelIndex modelIndex(int row) const { return model->index(row, column, root); }
378  inline bool isHidden(int row) const {
379  QModelIndex idx = model->index(row, 0, root);
380  return isPersistent(idx) && hiddenRows.contains(idx);
381  }
382  inline bool isHiddenOrDisabled(int row) const { return isHidden(row) || !isIndexEnabled(modelIndex(row)); }
383 
384  inline void removeCurrentAndDisabled(QVector<QModelIndex> *indexes, const QModelIndex &current) const {
386  while (it != indexes->end()) {
387  if (!isIndexEnabled(*it) || (*it) == current)
388  indexes->erase(it);
389  else
390  ++it;
391  }
392  }
393 
394  void scrollElasticBandBy(int dx, int dy);
395 
396  QItemViewPaintPairs draggablePaintPairs(const QModelIndexList &indexes, QRect *r) const;
397 
398  void emitIndexesMoved(const QModelIndexList &indexes) { emit q_func()->indexesMoved(indexes); }
399 
400 
402 
403  // ### FIXME: see if we can move the members into the dynamic/static classes
404 
405  bool wrap;
406  int space;
408 
414 
415  // the properties controlling the
416  // icon- or list-view modes
418  Wrap = 1,
419  Spacing = 2,
420  GridSize = 4,
421  Flow = 8,
422  Movement = 16,
423  ResizeMode = 32,
424  SelectionRectVisible = 64
425  };
426 
428 
430 
431  // timers
433 
434  // used for hidden items
436 
437  int column;
441 
444 };
445 
446 // inline implementations
447 
448 inline int QCommonListViewBase::spacing() const { return dd->spacing(); }
449 inline bool QCommonListViewBase::isWrapping() const { return dd->isWrapping(); }
450 inline QSize QCommonListViewBase::gridSize() const { return dd->gridSize(); }
451 inline QListView::Flow QCommonListViewBase::flow() const { return dd->flow; }
452 inline QListView::Movement QCommonListViewBase::movement() const { return dd->movement; }
453 
454 inline QPoint QCommonListViewBase::offset() const { return dd->offset(); }
455 inline QPoint QCommonListViewBase::pressedPosition() const { return dd->pressedPosition; }
456 inline bool QCommonListViewBase::uniformItemSizes() const { return dd->uniformItemSizes; }
457 inline int QCommonListViewBase::column() const { return dd->column; }
458 
459 inline QScrollBar *QCommonListViewBase::verticalScrollBar() const { return qq->verticalScrollBar(); }
460 inline QScrollBar *QCommonListViewBase::horizontalScrollBar() const { return qq->horizontalScrollBar(); }
461 inline QListView::ScrollMode QCommonListViewBase::verticalScrollMode() const { return qq->verticalScrollMode(); }
462 inline QListView::ScrollMode QCommonListViewBase::horizontalScrollMode() const { return qq->horizontalScrollMode(); }
463 
465  { return dd->model->index(row, dd->column, dd->root); }
466 inline int QCommonListViewBase::rowCount() const { return dd->model->rowCount(dd->root); }
467 
468 inline QStyleOptionViewItemV4 QCommonListViewBase::viewOptions() const { return dd->viewOptionsV4(); }
469 inline QWidget *QCommonListViewBase::viewport() const { return dd->viewport; }
470 inline QRect QCommonListViewBase::clipRect() const { return dd->clipRect(); }
471 
472 inline QSize QCommonListViewBase::cachedItemSize() const { return dd->cachedItemSize; }
473 inline QRect QCommonListViewBase::viewItemRect(const QListViewItem &item) const { return dd->viewItemRect(item); }
475  { return dd->itemSize(opt, idx); }
476 
478  { return dd->delegateForIndex(idx); }
479 
480 inline bool QCommonListViewBase::isHidden(int row) const { return dd->isHidden(row); }
481 inline int QCommonListViewBase::hiddenCount() const { return dd->hiddenRows.count(); }
482 
483 inline bool QCommonListViewBase::isRightToLeft() const { return qq->isRightToLeft(); }
484 
486 
487 #endif // QT_NO_LISTVIEW
488 
489 #endif // QLISTVIEW_P_H
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:86
void setContentsSize(int w, int h)
Definition: qlistview_p.h:323
void setGridSize(const QSize &size)
Definition: qlistview_p.h:368
double d
Definition: qnumeric_p.h:62
The QAbstractItemDelegate class is used to display and edit data items from a model.
int rowCount() const
Definition: qlistview_p.h:466
QRect flipX(const QRect &r) const
Definition: qlistview_p.h:329
void setRowCount(int rowCount)
Definition: qlistview_p.h:218
static mach_timebase_info_data_t info
QPoint pressedPosition() const
Definition: qlistview_p.h:455
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
QVector< int > segmentStartRows
Definition: qlistview_p.h:206
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
virtual ~QCommonListViewBase()
Definition: qlistview_p.h:124
EventRef event
int hiddenCount() const
Definition: qlistview_p.h:481
#define it(className, varName)
QVector< int > segmentPositions
Definition: qlistview_p.h:205
void setWrapping(bool b)
Definition: qlistview_p.h:370
QIconModeViewBase(QListView *q, QListViewPrivate *d)
Definition: qlistview_p.h:253
bool uniformItemSizes() const
Definition: qlistview_p.h:456
QVector< int > flowPositions
Definition: qlistview_p.h:204
bool isHiddenOrDisabled(int row) const
Definition: qlistview_p.h:382
virtual bool filterDropEvent(QDropEvent *)
Definition: qlistview_p.h:153
QPoint flipX(const QPoint &p) const
Definition: qlistview_p.h:327
QVector< QListViewItem > items
Definition: qlistview_p.h:256
QRect rectForIndex(const QModelIndex &index) const
Definition: qlistview_p.h:338
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
QListView::ViewMode viewMode
Definition: qlistview_p.h:413
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
The QStyleOptionViewItemV4 class is used to describe the parameters necessary for drawing a frame in ...
Definition: qstyleoption.h:609
QRect normalized() const
Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height...
Definition: qrect.cpp:322
static void clear(QVariant::Private *d)
Definition: qvariant.cpp:197
virtual void setPositionForIndex(const QPoint &, const QModelIndex &)
Definition: qlistview_p.h:147
QModelIndex modelIndex(int row) const
Definition: qlistview_p.h:377
QRect rect() const
Definition: qlistview_p.h:97
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
virtual QRect mapToViewport(const QRect &rect) const
Definition: qlistview_p.h:140
QSize cachedItemSize() const
Definition: qlistview_p.h:472
QListView::LayoutMode layoutMode
Definition: qlistview_p.h:412
long ASN1_INTEGER_get ASN1_INTEGER * a
DropIndicatorPosition
This enum indicates the position of the drop indicator in relation to the index at the current mouse ...
QSet< QPersistentModelIndex > hiddenRows
Definition: qlistview_p.h:435
QPoint offset() const
Definition: qlistview_p.h:454
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
QListView::ScrollMode horizontalScrollMode() const
Definition: qlistview_p.h:462
The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress...
Definition: qevent.h:530
bool isValid() const
Definition: qlistview_p.h:86
int height() const
Definition: qlistview_p.h:95
QSize gridSize() const
Definition: qlistview_p.h:369
QListView::Flow flow() const
Definition: qlistview_p.h:451
virtual bool filterDragMoveEvent(QDragMoveEvent *)
Definition: qlistview_p.h:151
QVector< QModelIndex > intersectingSet(const QRect &area, bool doLayout=true) const
Definition: qlistview_p.h:314
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
virtual bool filterStartDrag(Qt::DropActions)
Definition: qlistview_p.h:154
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the vector...
Definition: qvector.h:250
The QStyleOptionViewItemV2 class is used to describe the parameters necessary for drawing a frame in ...
Definition: qstyleoption.h:562
bool isHidden(int row) const
Definition: qlistview_p.h:378
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
Returns the index of the item in the model specified by the given row, column and parent index...
int width() const
Returns the width.
Definition: qsize.h:126
The QScrollBar widget provides a vertical or horizontal scroll bar.
Definition: qscrollbar.h:59
QPoint draggedItemsPos
Definition: qlistview_p.h:260
QListView::Flow flow
Definition: qlistview_p.h:113
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
bool isHidden(int row) const
Definition: qlistview_p.h:480
QListView::Movement movement() const
Definition: qlistview_p.h:452
QRect viewItemRect(const QListViewItem &item) const
Definition: qlistview_p.h:331
QSize itemSize(const QStyleOptionViewItemV2 &opt, const QModelIndex &idx) const
Definition: qlistview_p.h:474
virtual bool filterDragLeaveEvent(QDragLeaveEvent *)
Definition: qlistview_p.h:152
QVector< int > scrollValueMap
Definition: qlistview_p.h:208
int row() const
Returns the row this model index refers to.
void move(const QPoint &position)
Definition: qlistview_p.h:92
bool operator!=(const QListViewItem &other) const
Definition: qlistview_p.h:84
void removeCurrentAndDisabled(QVector< QModelIndex > *indexes, const QModelIndex &current) const
Definition: qlistview_p.h:384
#define emit
Definition: qobjectdefs.h:76
const QAbstractItemModel * model() const
Returns a pointer to the model containing the item that this index refers to.
bool selectionAllowed(const QModelIndex &index) const
Definition: qlistview_p.h:354
QBasicTimer batchLayoutTimer
Definition: qlistview_p.h:432
QSize gridSize() const
Definition: qlistview_p.h:450
static const char * data(const QByteArray &arr)
unsigned int uint
Definition: qglobal.h:996
bool isWrapping() const
Definition: qlistview_p.h:371
void emitIndexesMoved(const QModelIndexList &indexes)
Definition: qlistview_p.h:398
QAbstractItemDelegate * delegate(const QModelIndex &idx) const
Definition: qlistview_p.h:477
The QDragLeaveEvent class provides an event that is sent to a widget when a drag and drop action leav...
Definition: qevent.h:577
QVector< int > segmentExtents
Definition: qlistview_p.h:207
int width() const
Definition: qlistview_p.h:94
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
virtual int verticalOffset() const
Definition: qlistview_p.h:142
int spacing() const
Definition: qlistview_p.h:373
The QBitArray class provides an array of bits.
Definition: qbitarray.h:54
QListView::Movement movement
Definition: qlistview_p.h:410
QCommonListViewBase(QListView *q, QListViewPrivate *d)
Definition: qlistview_p.h:123
QListViewPrivate * dd
Definition: qlistview_p.h:192
int column() const
Definition: qlistview_p.h:457
#define Q_DECLARE_PUBLIC(Class)
Definition: qglobal.h:2477
The QItemSelection class manages information about selected items in a model.
The QDropEvent class provides an event which is sent when a drag and drop action is completed...
Definition: qevent.h:476
The QListView class provides a list or icon view onto a model.
Definition: qlistview.h:57
QScrollBar * horizontalScrollBar() const
Definition: qlistview_p.h:460
QCommonListViewBase * commonListView
Definition: qlistview_p.h:401
iterator begin()
Returns an STL-style iterator pointing to the first item in the vector.
Definition: qvector.h:247
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
The Flow item arranges its children side by side, wrapping as necessary.
bool isSelectionRectVisible() const
Definition: qlistview_p.h:375
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
QRect viewItemRect(const QListViewItem &item) const
Definition: qlistview_p.h:473
QModelIndex modelIndex(int row) const
Definition: qlistview_p.h:464
int spacing() const
Definition: qlistview_p.h:448
iterator erase(iterator begin, iterator end)
Removes all the items from begin up to (but not including) end.
Definition: qvector.h:627
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
void setSpacing(int s)
Definition: qlistview_p.h:372
The QModelIndex class is used to locate data in a data model.
QRect clipRect() const
Definition: qlistview_p.h:470
void invalidate()
Definition: qlistview_p.h:88
int height() const
Returns the height.
Definition: qsize.h:129
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QVector< QModelIndex > * interSectingVector
Definition: qlistview_p.h:263
bool isRightToLeft() const
Definition: qlistview_p.h:483
QListModeViewBase(QListView *q, QListViewPrivate *d)
Definition: qlistview_p.h:202
int flipX(int x) const
Definition: qlistview_p.h:325
friend class QListViewPrivate
Definition: qlistview_p.h:69
int batchStartRow() const
Definition: qlistview_p.h:321
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
quint16 index
The QBasicTimer class provides timer events for objects.
Definition: qbasictimer.h:55
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
void viewUpdateGeometries()
Definition: qlistview_p.h:346
bool isWrapping() const
Definition: qlistview_p.h:449
QScrollBar * verticalScrollBar() const
Definition: qlistview_p.h:459
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
The QStyleOptionViewItem class is used to describe the parameters used to draw an item in a view widg...
Definition: qstyleoption.h:539
bool operator==(const QListViewItem &other) const
Definition: qlistview_p.h:81
void setSelectionRectVisible(bool visible)
Definition: qlistview_p.h:374
bool isValid() const
Returns true if the rectangle is valid, otherwise returns false.
Definition: qrect.h:237
QListView::Flow flow
Definition: qlistview_p.h:409
QVector< QModelIndex > draggedItems
Definition: qlistview_p.h:259
QModelIndex listViewItemToIndex(const QListViewItem &item) const
Definition: qlistview_p.h:335
Orientation
Definition: qnamespace.h:174
int itemIndex(const QListViewItem &item) const
Definition: qlistview_p.h:214
QListViewItem(QRect r, int i)
Definition: qlistview_p.h:78
QListView::ScrollMode verticalScrollMode() const
Definition: qlistview_p.h:461
void resize(const QSize &size)
Definition: qlistview_p.h:90
void resetBatchStartRow()
Definition: qlistview_p.h:320
QListViewItem(const QListViewItem &other)
Definition: qlistview_p.h:75
QWidget * viewport() const
Definition: qlistview_p.h:469
QListView::ResizeMode resizeMode
Definition: qlistview_p.h:411
int column() const
Returns the column this model index refers to.
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
static int area(const QSize &s)
Definition: qicon.cpp:155
QSize contentsSize() const
Definition: qlistview_p.h:322
QStyleOptionViewItemV4 viewOptions() const
Definition: qlistview_p.h:468