Qt 4.8
Public Functions | Public Variables | Private Functions | Static Private Functions | List of all members
QIconModeViewBase Class Reference

#include <qlistview_p.h>

Inheritance diagram for QIconModeViewBase:
QCommonListViewBase

Public Functions

void appendHiddenRow (int row)
 
void clear ()
 
void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)
 
bool doBatchedItemLayout (const QListViewLayoutInfo &info, int max)
 
bool filterDragLeaveEvent (QDragLeaveEvent *)
 
bool filterDragMoveEvent (QDragMoveEvent *)
 
bool filterDropEvent (QDropEvent *e)
 
bool filterStartDrag (Qt::DropActions)
 
QListViewItem indexToListViewItem (const QModelIndex &index) const
 
QVector< QModelIndexintersectingSet (const QRect &area) const
 
int itemIndex (const QListViewItem &item) const
 
 QIconModeViewBase (QListView *q, QListViewPrivate *d)
 
void removeHiddenRow (int row)
 
void scrollContentsBy (int dx, int dy, bool scrollElasticBand)
 
void setPositionForIndex (const QPoint &position, const QModelIndex &index)
 
void setRowCount (int rowCount)
 
- Public Functions inherited from QCommonListViewBase
QSize cachedItemSize () const
 
QRect clipRect () const
 
int column () const
 
QAbstractItemDelegatedelegate (const QModelIndex &idx) const
 
QListView::Flow flow () const
 
QSize gridSize () const
 
int hiddenCount () const
 
virtual int horizontalOffset () const
 
QScrollBarhorizontalScrollBar () const
 
QListView::ScrollMode horizontalScrollMode () const
 
virtual int horizontalScrollToValue (int index, QListView::ScrollHint hint, bool leftOf, bool rightOf, const QRect &area, const QRect &rect) const
 
bool isHidden (int row) const
 
bool isRightToLeft () const
 
bool isWrapping () const
 
QSize itemSize (const QStyleOptionViewItemV2 &opt, const QModelIndex &idx) const
 
virtual QRect mapToViewport (const QRect &rect) const
 
QModelIndex modelIndex (int row) const
 
QListView::Movement movement () const
 
QPoint offset () const
 
void paintDragDrop (QPainter *painter)
 
QPoint pressedPosition () const
 
 QCommonListViewBase (QListView *q, QListViewPrivate *d)
 
int rowCount () const
 
int spacing () const
 
bool uniformItemSizes () const
 
virtual void updateHorizontalScrollBar (const QSize &step)
 
virtual void updateVerticalScrollBar (const QSize &step)
 
virtual int verticalOffset () const
 
QScrollBarverticalScrollBar () const
 
QListView::ScrollMode verticalScrollMode () const
 
virtual int verticalScrollToValue (int index, QListView::ScrollHint hint, bool above, bool below, const QRect &area, const QRect &rect) const
 
QRect viewItemRect (const QListViewItem &item) const
 
QStyleOptionViewItemV4 viewOptions () const
 
QWidgetviewport () const
 
virtual ~QCommonListViewBase ()
 

Public Variables

QVector< QModelIndexdraggedItems
 
QPoint draggedItemsPos
 
QVector< QModelIndex > * interSectingVector
 
QVector< QListViewItemitems
 
QBitArray moved
 
QBspTree tree
 
- Public Variables inherited from QCommonListViewBase
int batchSavedDeltaSeg
 
int batchStartRow
 
QSize contentsSize
 
QListViewPrivatedd
 
QListViewqq
 

Private Functions

void doDynamicLayout (const QListViewLayoutInfo &info)
 
QPoint draggedItemsDelta () const
 
QRect draggedItemsRect () const
 
void drawItems (QPainter *painter, const QVector< QModelIndex > &indexes) const
 
void initBspTree (const QSize &contents)
 
QPoint initDynamicLayout (const QListViewLayoutInfo &info)
 
QRect itemsRect (const QVector< QModelIndex > &indexes) const
 
void moveItem (int index, const QPoint &dest)
 
QPoint snapToGrid (const QPoint &pos) const
 
void updateContentsSize ()
 

Static Private Functions

static void addLeaf (QVector< int > &leaf, const QRect &area, uint visited, QBspTree::Data data)
 

Detailed Description

Definition at line 250 of file qlistview_p.h.

Constructors and Destructors

◆ QIconModeViewBase()

QIconModeViewBase::QIconModeViewBase ( QListView q,
QListViewPrivate d 
)
inline

Definition at line 253 of file qlistview_p.h.

QCommonListViewBase(QListView *q, QListViewPrivate *d)
Definition: qlistview_p.h:123
QVector< QModelIndex > * interSectingVector
Definition: qlistview_p.h:263

Functions

◆ addLeaf()

void QIconModeViewBase::addLeaf ( QVector< int > &  leaf,
const QRect area,
uint  visited,
QBspTree::Data  data 
)
staticprivate

Definition at line 3146 of file qlistview.cpp.

Referenced by intersectingSet().

3148 {
3149  QListViewItem *vi;
3150  QIconModeViewBase *_this = static_cast<QIconModeViewBase *>(data.ptr);
3151  for (int i = 0; i < leaf.count(); ++i) {
3152  int idx = leaf.at(i);
3153  if (idx < 0 || idx >= _this->items.count())
3154  continue;
3155  vi = &_this->items[idx];
3156  Q_ASSERT(vi);
3157  if (vi->isValid() && vi->rect().intersects(area) && vi->visited != visited) {
3158  QModelIndex index = _this->dd->listViewItemToIndex(*vi);
3159  Q_ASSERT(index.isValid());
3160  _this->interSectingVector->append(index);
3161  vi->visited = visited;
3162  }
3163  }
3164 }
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
QVector< QListViewItem > items
Definition: qlistview_p.h:256
QRect rect() const
Definition: qlistview_p.h:97
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
bool isValid() const
Definition: qlistview_p.h:86
void append(const T &t)
Inserts value at the end of the vector.
Definition: qvector.h:573
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
QListViewPrivate * dd
Definition: qlistview_p.h:192
The QModelIndex class is used to locate data in a data model.
QVector< QModelIndex > * interSectingVector
Definition: qlistview_p.h:263
quint16 index
bool intersects(const QRect &r) const
Returns true if this rectangle intersects with the given rectangle (i.
Definition: qrect.cpp:1429
QModelIndex listViewItemToIndex(const QListViewItem &item) const
Definition: qlistview_p.h:335

◆ appendHiddenRow()

void QIconModeViewBase::appendHiddenRow ( int  row)
virtual

Reimplemented from QCommonListViewBase.

Definition at line 2730 of file qlistview.cpp.

2731 {
2732  if (row >= 0 && row < items.count()) //remove item
2733  tree.removeLeaf(items.at(row).rect(), row);
2735 }
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
QVector< QListViewItem > items
Definition: qlistview_p.h:256
QRect rect() const
Definition: qlistview_p.h:97
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
virtual void appendHiddenRow(int row)
Definition: qlistview.cpp:1913
void removeLeaf(const QRect &r, int i)
Definition: qbsptree_p.h:98

◆ clear()

void QIconModeViewBase::clear ( )
virtual

Implements QCommonListViewBase.

Definition at line 3222 of file qlistview.cpp.

3223 {
3224  tree.destroy();
3225  items.clear();
3226  moved.clear();
3227  batchStartRow = 0;
3228  batchSavedDeltaSeg = 0;
3229 }
void clear()
Clears the contents of the bit array and makes it empty.
Definition: qbitarray.h:85
QVector< QListViewItem > items
Definition: qlistview_p.h:256
void clear()
Removes all the elements from the vector and releases the memory used by the vector.
Definition: qvector.h:347
void destroy()
Definition: qbsptree.cpp:65

◆ dataChanged()

void QIconModeViewBase::dataChanged ( const QModelIndex topLeft,
const QModelIndex bottomRight 
)
virtual

Implements QCommonListViewBase.

Definition at line 2879 of file qlistview.cpp.

2880 {
2881  if (column() >= topLeft.column() && column() <= bottomRight.column()) {
2883  int bottom = qMin(items.count(), bottomRight.row() + 1);
2884  for (int row = topLeft.row(); row < bottom; ++row)
2885  items[row].resize(itemSize(option, modelIndex(row)));
2886  }
2887 }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
QVector< QListViewItem > items
Definition: qlistview_p.h:256
The QStyleOptionViewItemV4 class is used to describe the parameters necessary for drawing a frame in ...
Definition: qstyleoption.h:609
QSize itemSize(const QStyleOptionViewItemV2 &opt, const QModelIndex &idx) const
Definition: qlistview_p.h:474
int row() const
Returns the row this model index refers to.
int column() const
Definition: qlistview_p.h:457
QModelIndex modelIndex(int row) const
Definition: qlistview_p.h:464
int column() const
Returns the column this model index refers to.
QStyleOptionViewItemV4 viewOptions() const
Definition: qlistview_p.h:468

◆ doBatchedItemLayout()

bool QIconModeViewBase::doBatchedItemLayout ( const QListViewLayoutInfo info,
int  max 
)
virtual

Implements QCommonListViewBase.

Definition at line 2889 of file qlistview.cpp.

2890 {
2891  if (info.last >= items.count()) {
2892  //first we create the items
2894  for (int row = items.count(); row <= info.last; ++row) {
2895  QSize size = itemSize(option, modelIndex(row));
2896  QListViewItem item(QRect(0, 0, size.width(), size.height()), row); // default pos
2897  items.append(item);
2898  }
2899  doDynamicLayout(info);
2900  }
2901  return (batchStartRow > max); // done
2902 }
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
QVector< QListViewItem > items
Definition: qlistview_p.h:256
The QStyleOptionViewItemV4 class is used to describe the parameters necessary for drawing a frame in ...
Definition: qstyleoption.h:609
int width() const
Returns the width.
Definition: qsize.h:126
QSize itemSize(const QStyleOptionViewItemV2 &opt, const QModelIndex &idx) const
Definition: qlistview_p.h:474
void append(const T &t)
Inserts value at the end of the vector.
Definition: qvector.h:573
QModelIndex modelIndex(int row) const
Definition: qlistview_p.h:464
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
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
void doDynamicLayout(const QListViewLayoutInfo &info)
Definition: qlistview.cpp:2953
QStyleOptionViewItemV4 viewOptions() const
Definition: qlistview_p.h:468

◆ doDynamicLayout()

void QIconModeViewBase::doDynamicLayout ( const QListViewLayoutInfo info)
private
Warning
This function is not part of the public interface.

Definition at line 2953 of file qlistview.cpp.

2954 {
2955  const bool useItemSize = !info.grid.isValid();
2956  const QPoint topLeft = initDynamicLayout(info);
2957 
2958  int segStartPosition;
2959  int segEndPosition;
2960  int deltaFlowPosition;
2961  int deltaSegPosition;
2962  int deltaSegHint;
2963  int flowPosition;
2964  int segPosition;
2965 
2966  if (info.flow == QListView::LeftToRight) {
2967  segStartPosition = info.bounds.left() + info.spacing;
2968  segEndPosition = info.bounds.right();
2969  deltaFlowPosition = info.grid.width(); // dx
2970  deltaSegPosition = (useItemSize ? batchSavedDeltaSeg : info.grid.height()); // dy
2971  deltaSegHint = info.grid.height();
2972  flowPosition = topLeft.x();
2973  segPosition = topLeft.y();
2974  } else { // flow == QListView::TopToBottom
2975  segStartPosition = info.bounds.top() + info.spacing;
2976  segEndPosition = info.bounds.bottom();
2977  deltaFlowPosition = info.grid.height(); // dy
2978  deltaSegPosition = (useItemSize ? batchSavedDeltaSeg : info.grid.width()); // dx
2979  deltaSegHint = info.grid.width();
2980  flowPosition = topLeft.y();
2981  segPosition = topLeft.x();
2982  }
2983 
2984  if (moved.count() != items.count())
2985  moved.resize(items.count());
2986 
2987  QRect rect(QPoint(), topLeft);
2988  QListViewItem *item = 0;
2989  for (int row = info.first; row <= info.last; ++row) {
2990  item = &items[row];
2991  if (isHidden(row)) {
2992  item->invalidate();
2993  } else {
2994  // if we are not using a grid, we need to find the deltas
2995  if (useItemSize) {
2996  if (info.flow == QListView::LeftToRight)
2997  deltaFlowPosition = item->w + info.spacing;
2998  else
2999  deltaFlowPosition = item->h + info.spacing;
3000  } else {
3001  item->w = qMin<int>(info.grid.width(), item->w);
3002  item->h = qMin<int>(info.grid.height(), item->h);
3003  }
3004 
3005  // create new segment
3006  if (info.wrap
3007  && flowPosition + deltaFlowPosition > segEndPosition
3008  && flowPosition > segStartPosition) {
3009  flowPosition = segStartPosition;
3010  segPosition += deltaSegPosition;
3011  if (useItemSize)
3012  deltaSegPosition = 0;
3013  }
3014  // We must delay calculation of the seg adjustment, as this item
3015  // may have caused a wrap to occur
3016  if (useItemSize) {
3017  if (info.flow == QListView::LeftToRight)
3018  deltaSegHint = item->h + info.spacing;
3019  else
3020  deltaSegHint = item->w + info.spacing;
3021  deltaSegPosition = qMax(deltaSegPosition, deltaSegHint);
3022  }
3023 
3024  // set the position of the item
3025  // ### idealy we should have some sort of alignment hint for the item
3026  // ### (normally that would be a point between the icon and the text)
3027  if (!moved.testBit(row)) {
3028  if (info.flow == QListView::LeftToRight) {
3029  if (useItemSize) {
3030  item->x = flowPosition;
3031  item->y = segPosition;
3032  } else { // use grid
3033  item->x = flowPosition + ((deltaFlowPosition - item->w) / 2);
3034  item->y = segPosition;
3035  }
3036  } else { // TopToBottom
3037  if (useItemSize) {
3038  item->y = flowPosition;
3039  item->x = segPosition;
3040  } else { // use grid
3041  item->y = flowPosition + ((deltaFlowPosition - item->h) / 2);
3042  item->x = segPosition;
3043  }
3044  }
3045  }
3046 
3047  // let the contents contain the new item
3048  if (useItemSize)
3049  rect |= item->rect();
3050  else if (info.flow == QListView::LeftToRight)
3051  rect |= QRect(flowPosition, segPosition, deltaFlowPosition, deltaSegPosition);
3052  else // flow == TopToBottom
3053  rect |= QRect(segPosition, flowPosition, deltaSegPosition, deltaFlowPosition);
3054 
3055  // prepare for next item
3056  flowPosition += deltaFlowPosition; // current position + item width + gap
3057  }
3058  }
3059  batchSavedDeltaSeg = deltaSegPosition;
3060  batchStartRow = info.last + 1;
3061  bool done = (info.last >= rowCount() - 1);
3062  // resize the content area
3063  if (done || !info.bounds.contains(item->rect())) {
3064  contentsSize = rect.size();
3065  if (info.flow == QListView::LeftToRight)
3066  contentsSize.rheight() += info.spacing;
3067  else
3068  contentsSize.rwidth() += info.spacing;
3069  }
3070  if (rect.size().isEmpty())
3071  return;
3072  // resize tree
3073  int insertFrom = info.first;
3074  if (done || info.first == 0) {
3075  initBspTree(rect.size());
3076  insertFrom = 0;
3077  }
3078  // insert items in tree
3079  for (int row = insertFrom; row <= info.last; ++row)
3080  tree.insertLeaf(items.at(row).rect(), row);
3081  // if the new items are visble, update the viewport
3082  QRect changedRect(topLeft, rect.bottomRight());
3083  if (clipRect().intersects(changedRect))
3084  viewport()->update();
3085 }
void insertLeaf(const QRect &r, int i)
Definition: qbsptree_p.h:97
int rowCount() const
Definition: qlistview_p.h:466
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
QVector< QListViewItem > items
Definition: qlistview_p.h:256
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
QRect rect() const
Definition: qlistview_p.h:97
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
void initBspTree(const QSize &contents)
Definition: qlistview.cpp:2911
bool testBit(int i) const
Returns true if the bit at index position i is 1; otherwise returns false.
Definition: qbitarray.h:124
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
void update()
Updates the widget unless updates are disabled or the widget is hidden.
Definition: qwidget.cpp:10883
int width() const
Returns the width.
Definition: qsize.h:126
QListView::Flow flow
Definition: qlistview_p.h:113
bool isHidden(int row) const
Definition: qlistview_p.h:480
void resize(int size)
Resizes the bit array to size bits.
Definition: qbitarray.cpp:214
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
Definition: qrect.cpp:1101
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
QPoint initDynamicLayout(const QListViewLayoutInfo &info)
Definition: qlistview.cpp:2928
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QRect clipRect() const
Definition: qlistview_p.h:470
int & rheight()
Returns a reference to the height.
Definition: qsize.h:144
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
bool isValid() const
Returns true if both the width and height is equal to or greater than 0; otherwise returns false...
Definition: qsize.h:123
int count() const
Same as size().
Definition: qbitarray.h:74
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
static QFixed flowPosition(const QTextFrame::iterator it)
bool intersects(const QRect &r) const
Returns true if this rectangle intersects with the given rectangle (i.
Definition: qrect.cpp:1429
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
QWidget * viewport() const
Definition: qlistview_p.h:469
int & rwidth()
Returns a reference to the width.
Definition: qsize.h:141

◆ draggedItemsDelta()

QPoint QIconModeViewBase::draggedItemsDelta ( ) const
private

Definition at line 3193 of file qlistview.cpp.

3194 {
3195  if (movement() == QListView::Snap) {
3196  QPoint snapdelta = QPoint((offset().x() % gridSize().width()),
3197  (offset().y() % gridSize().height()));
3198  return snapToGrid(draggedItemsPos + snapdelta) - snapToGrid(pressedPosition()) - snapdelta;
3199  }
3200  return draggedItemsPos - pressedPosition();
3201 }
QPoint snapToGrid(const QPoint &pos) const
Definition: qlistview.cpp:3186
QPoint pressedPosition() const
Definition: qlistview_p.h:455
QPoint offset() const
Definition: qlistview_p.h:454
QPoint draggedItemsPos
Definition: qlistview_p.h:260
QListView::Movement movement() const
Definition: qlistview_p.h:452
QSize gridSize() const
Definition: qlistview_p.h:450
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53

◆ draggedItemsRect()

QRect QIconModeViewBase::draggedItemsRect ( ) const
private

Definition at line 3203 of file qlistview.cpp.

3204 {
3205  QRect rect = itemsRect(draggedItems);
3206  rect.translate(draggedItemsDelta());
3207  return rect;
3208 }
QRect itemsRect(const QVector< QModelIndex > &indexes) const
Definition: qlistview.cpp:3098
QPoint draggedItemsDelta() const
Definition: qlistview.cpp:3193
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
void translate(int dx, int dy)
Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position...
Definition: qrect.h:312
QVector< QModelIndex > draggedItems
Definition: qlistview_p.h:259

◆ drawItems()

void QIconModeViewBase::drawItems ( QPainter painter,
const QVector< QModelIndex > &  indexes 
) const
private

◆ filterDragLeaveEvent()

bool QIconModeViewBase::filterDragLeaveEvent ( QDragLeaveEvent e)
virtual

Reimplemented from QCommonListViewBase.

Definition at line 2819 of file qlistview.cpp.

2820 {
2821  viewport()->update(draggedItemsRect()); // erase the area
2822  draggedItemsPos = QPoint(-1, -1); // don't draw the dragged items
2824 }
void update()
Updates the widget unless updates are disabled or the widget is hidden.
Definition: qwidget.cpp:10883
QPoint draggedItemsPos
Definition: qlistview_p.h:260
virtual bool filterDragLeaveEvent(QDragLeaveEvent *)
Definition: qlistview_p.h:152
QRect draggedItemsRect() const
Definition: qlistview.cpp:3203
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QWidget * viewport() const
Definition: qlistview_p.h:469

◆ filterDragMoveEvent()

bool QIconModeViewBase::filterDragMoveEvent ( QDragMoveEvent e)
virtual

Reimplemented from QCommonListViewBase.

Definition at line 2826 of file qlistview.cpp.

2827 {
2828  if (e->source() != qq || !dd->canDecode(e))
2829  return false;
2830 
2831  // ignore by default
2832  e->ignore();
2833  // get old dragged items rect
2835  viewport()->update(itemsRect.translated(draggedItemsDelta()));
2836  // update position
2837  draggedItemsPos = e->pos();
2838  // get new items rect
2839  viewport()->update(itemsRect.translated(draggedItemsDelta()));
2840  // set the item under the cursor to current
2842  if (movement() == QListView::Snap) {
2843  QRect rect(snapToGrid(e->pos() + offset()), gridSize());
2844  const QVector<QModelIndex> intersectVector = intersectingSet(rect);
2845  index = intersectVector.count() > 0 ? intersectVector.last() : QModelIndex();
2846  } else {
2847  index = qq->indexAt(e->pos());
2848  }
2849  // check if we allow drops here
2850  if (draggedItems.contains(index))
2851  e->accept(); // allow changing item position
2852  else if (dd->model->flags(index) & Qt::ItemIsDropEnabled)
2853  e->accept(); // allow dropping on dropenabled items
2854  else if (!index.isValid())
2855  e->accept(); // allow dropping in empty areas
2856 
2857  // the event was treated. do autoscrolling
2858  if (dd->shouldAutoScroll(e->pos()))
2859  dd->startAutoScroll();
2860  return true;
2861 }
QPoint snapToGrid(const QPoint &pos) const
Definition: qlistview.cpp:3186
QVector< QModelIndex > intersectingSet(const QRect &area) const
Definition: qlistview.cpp:3087
QRect itemsRect(const QVector< QModelIndex > &indexes) const
Definition: qlistview.cpp:3098
void accept()
Calls QDropEvent::accept().
Definition: qevent.h:539
QRect translated(int dx, int dy) const
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis...
Definition: qrect.h:328
QPoint offset() const
Definition: qlistview_p.h:454
QModelIndex indexAt(const QPoint &p) const
Reimplemented Function
Definition: qlistview.cpp:1112
void update()
Updates the widget unless updates are disabled or the widget is hidden.
Definition: qwidget.cpp:10883
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Returns the item flags for the given index.
QPoint draggedItemsPos
Definition: qlistview_p.h:260
QListView::Movement movement() const
Definition: qlistview_p.h:452
QPoint draggedItemsDelta() const
Definition: qlistview.cpp:3193
bool canDecode(QDropEvent *e) const
QSize gridSize() const
Definition: qlistview_p.h:450
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
QListViewPrivate * dd
Definition: qlistview_p.h:192
QWidget * source() const
If the source of the drag operation is a widget in this application, this function returns that sourc...
Definition: qevent.cpp:2739
The QModelIndex class is used to locate data in a data model.
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
bool contains(const T &t) const
Returns true if the vector contains an occurrence of value; otherwise returns false.
Definition: qvector.h:731
quint16 index
QVector< QModelIndex > draggedItems
Definition: qlistview_p.h:259
QAbstractItemModel * model
void ignore()
Calls QDropEvent::ignore().
Definition: qevent.h:540
QWidget * viewport() const
Definition: qlistview_p.h:469
const QPoint & pos() const
Returns the position where the drop was made.
Definition: qevent.h:486
bool shouldAutoScroll(const QPoint &pos) const

◆ filterDropEvent()

bool QIconModeViewBase::filterDropEvent ( QDropEvent e)
virtual

Reimplemented from QCommonListViewBase.

Definition at line 2776 of file qlistview.cpp.

2777 {
2778  if (e->source() != qq)
2779  return false;
2780 
2781  const QSize contents = contentsSize;
2783  QPoint end = e->pos() + offset;
2784  if (qq->acceptDrops()) {
2785  const Qt::ItemFlags dropableFlags = Qt::ItemIsDropEnabled|Qt::ItemIsEnabled;
2786  const QVector<QModelIndex> &dropIndices = intersectingSet(QRect(end, QSize(1, 1)));
2787  foreach (const QModelIndex &index, dropIndices)
2788  if ((index.flags() & dropableFlags) == dropableFlags)
2789  return false;
2790  }
2791  QPoint start = dd->pressedPosition;
2792  QPoint delta = (dd->movement == QListView::Snap ? snapToGrid(end) - snapToGrid(start) : end - start);
2794  for (int i = 0; i < indexes.count(); ++i) {
2795  QModelIndex index = indexes.at(i);
2796  QRect rect = dd->rectForIndex(index);
2797  viewport()->update(dd->mapToViewport(rect, false));
2798  QPoint dest = rect.topLeft() + delta;
2799  if (qq->isRightToLeft())
2800  dest.setX(dd->flipX(dest.x()) - rect.width());
2801  moveItem(index.row(), dest);
2802  qq->update(index);
2803  }
2804  dd->stopAutoScroll();
2805  draggedItems.clear();
2806  dd->emitIndexesMoved(indexes);
2807  e->accept(); // we have handled the event
2808  // if the size has not grown, we need to check if it has shrinked
2809  if (contentsSize != contents) {
2810  if ((contentsSize.width() <= contents.width()
2811  || contentsSize.height() <= contents.height())) {
2813  }
2815  }
2816  return true;
2817 }
QPoint snapToGrid(const QPoint &pos) const
Definition: qlistview.cpp:3186
QRect mapToViewport(const QRect &rect, bool extend=true) const
Definition: qlistview.cpp:1799
QVector< QModelIndex > intersectingSet(const QRect &area) const
Definition: qlistview.cpp:3087
bool acceptDrops() const
QModelIndexList selectedIndexes() const
Returns a list of all selected model item indexes.
QRect rectForIndex(const QModelIndex &index) const
Definition: qlistview_p.h:338
void updateContentsSize()
Definition: qlistview.cpp:3231
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
QPointer< QItemSelectionModel > selectionModel
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
QPoint offset() const
Definition: qlistview_p.h:454
virtual int horizontalOffset() const
Definition: qlistview.cpp:1965
void update()
Updates the widget unless updates are disabled or the widget is hidden.
Definition: qwidget.cpp:10883
int width() const
Returns the width.
Definition: qsize.h:126
void clear()
Removes all the elements from the vector and releases the memory used by the vector.
Definition: qvector.h:347
int row() const
Returns the row this model index refers to.
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
void emitIndexesMoved(const QModelIndexList &indexes)
Definition: qlistview_p.h:398
virtual int verticalOffset() const
Definition: qlistview_p.h:142
Qt::ItemFlags flags() const
Returns the flags for the item referred to by the index.
QListView::Movement movement
Definition: qlistview_p.h:410
void moveItem(int index, const QPoint &dest)
Definition: qlistview.cpp:3166
QListViewPrivate * dd
Definition: qlistview_p.h:192
QWidget * source() const
If the source of the drag operation is a widget in this application, this function returns that sourc...
Definition: qevent.cpp:2739
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QModelIndex class is used to locate data in a data model.
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
int flipX(int x) const
Definition: qlistview_p.h:325
quint16 index
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
Definition: qcoreevent.h:309
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
bool isRightToLeft() const
Definition: qwidget.h:428
void viewUpdateGeometries()
Definition: qlistview_p.h:346
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
static const KeyPair *const end
QVector< QModelIndex > draggedItems
Definition: qlistview_p.h:259
void setX(int x)
Sets the x coordinate of this point to the given x coordinate.
Definition: qpoint.h:134
QWidget * viewport() const
Definition: qlistview_p.h:469
const QPoint & pos() const
Returns the position where the drop was made.
Definition: qevent.h:486
void update(const QModelIndex &index)
Updates the area occupied by the given index.
QPoint topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:288

◆ filterStartDrag()

bool QIconModeViewBase::filterStartDrag ( Qt::DropActions  supportedActions)
virtual

Reimplemented from QCommonListViewBase.

Definition at line 2745 of file qlistview.cpp.

2746 {
2747  // This function does the same thing as in QAbstractItemView::startDrag(),
2748  // plus adding viewitems to the draggedItems list.
2749  // We need these items to draw the drag items
2751  if (indexes.count() > 0 ) {
2752  if (viewport()->acceptDrops()) {
2754  for (; it != indexes.constEnd(); ++it)
2755  if (dd->model->flags(*it) & Qt::ItemIsDragEnabled
2756  && (*it).column() == dd->column)
2757  draggedItems.push_back(*it);
2758  }
2759 
2760  QRect rect;
2761  QPixmap pixmap = dd->renderToPixmap(indexes, &rect);
2762  rect.adjust(horizontalOffset(), verticalOffset(), 0, 0);
2763 
2764  QDrag *drag = new QDrag(qq);
2765  drag->setPixmap(pixmap);
2766  drag->setHotSpot(dd->pressedPosition - rect.topLeft());
2767  drag->setMimeData(dd->model->mimeData(indexes));
2768  Qt::DropAction action = drag->exec(supportedActions, Qt::CopyAction);
2769  draggedItems.clear();
2770  if (action == Qt::MoveAction)
2771  dd->clearOrRemove();
2772  }
2773  return true;
2774 }
void setPixmap(const QPixmap &)
Sets pixmap as the pixmap used to represent the data in a drag and drop operation.
Definition: qdrag.cpp:166
The QDrag class provides support for MIME-based drag and drop data transfer.
Definition: qdrag.h:61
void setMimeData(QMimeData *data)
Sets the data to be sent to the given MIME data.
Definition: qdrag.cpp:142
#define it(className, varName)
QModelIndexList selectedIndexes() const
Returns a list of all selected model item indexes.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
Definition: qlist.h:269
QPointer< QItemSelectionModel > selectionModel
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
Qt::DropAction exec(Qt::DropActions supportedActions=Qt::MoveAction)
Starts the drag and drop operation and returns a value indicating the requested drop action when it i...
Definition: qdrag.cpp:243
virtual int horizontalOffset() const
Definition: qlistview.cpp:1965
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Returns the item flags for the given index.
void clearOrRemove()
In DND if something has been moved then this is called.
QPixmap renderToPixmap(const QModelIndexList &indexes, QRect *r) const
void clear()
Removes all the elements from the vector and releases the memory used by the vector.
Definition: qvector.h:347
void adjust(int x1, int y1, int x2, int y2)
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
Definition: qrect.h:434
DropAction
Definition: qnamespace.h:1597
bool acceptDrops
whether drop events are enabled for this widget
Definition: qwidget.h:197
virtual int verticalOffset() const
Definition: qlistview_p.h:142
QListViewPrivate * dd
Definition: qlistview_p.h:192
const_iterator ConstIterator
Qt-style synonym for QList::const_iterator.
Definition: qlist.h:279
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
void push_back(const T &t)
This function is provided for STL compatibility.
Definition: qvector.h:281
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
void setHotSpot(const QPoint &hotspot)
Sets the position of the hot spot relative to the top-left corner of the pixmap used to the point spe...
Definition: qdrag.cpp:189
QVector< QModelIndex > draggedItems
Definition: qlistview_p.h:259
QAbstractItemModel * model
QWidget * viewport() const
Definition: qlistview_p.h:469
virtual QMimeData * mimeData(const QModelIndexList &indexes) const
Returns an object that contains serialized items of data corresponding to the list of indexes specifi...
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
Definition: qlist.h:272
QPoint topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:288

◆ indexToListViewItem()

QListViewItem QIconModeViewBase::indexToListViewItem ( const QModelIndex index) const
virtual

Implements QCommonListViewBase.

Definition at line 2904 of file qlistview.cpp.

2905 {
2906  if (index.isValid() && index.row() < items.count())
2907  return items.at(index.row());
2908  return QListViewItem();
2909 }
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
QVector< QListViewItem > items
Definition: qlistview_p.h:256
int row() const
Returns the row this model index refers to.
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350

◆ initBspTree()

void QIconModeViewBase::initBspTree ( const QSize contents)
private

Definition at line 2911 of file qlistview.cpp.

2912 {
2913  // remove all items from the tree
2914  int leafCount = tree.leafCount();
2915  for (int l = 0; l < leafCount; ++l)
2916  tree.leaf(l).clear();
2917  // we have to get the bounding rect of the items before we can initialize the tree
2919  // simple heuristics to get better bsp
2920  if (contents.height() / contents.width() >= 3)
2922  else if (contents.width() / contents.height() >= 3)
2924  // build tree for the bounding rect (not just the contents rect)
2925  tree.init(QRect(0, 0, contents.width(), contents.height()), type);
2926 }
int type
Definition: qmetatype.cpp:239
QVector< int > & leaf(int i)
Definition: qbsptree_p.h:96
void init(const QRect &area, NodeType type)
Definition: qbsptree_p.h:91
int width() const
Returns the width.
Definition: qsize.h:126
void clear()
Removes all the elements from the vector and releases the memory used by the vector.
Definition: qvector.h:347
int leafCount() const
Definition: qbsptree_p.h:95
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
QFactoryLoader * l

◆ initDynamicLayout()

QPoint QIconModeViewBase::initDynamicLayout ( const QListViewLayoutInfo info)
private

Definition at line 2928 of file qlistview.cpp.

2929 {
2930  int x, y;
2931  if (info.first == 0) {
2932  x = info.bounds.x() + info.spacing;
2933  y = info.bounds.y() + info.spacing;
2935  } else {
2936  int idx = info.first - 1;
2937  while (idx > 0 && !items.at(idx).isValid())
2938  --idx;
2939  const QListViewItem &item = items.at(idx);
2940  x = item.x;
2941  y = item.y;
2942  if (info.flow == QListView::LeftToRight)
2943  x += (info.grid.isValid() ? info.grid.width() : item.w) + info.spacing;
2944  else
2945  y += (info.grid.isValid() ? info.grid.height() : item.h) + info.spacing;
2946  }
2947  return QPoint(x, y);
2948 }
int rowCount() const
Definition: qlistview_p.h:466
int hiddenCount() const
Definition: qlistview_p.h:481
QVector< QListViewItem > items
Definition: qlistview_p.h:256
bool isValid() const
Definition: qlistview_p.h:86
int width() const
Returns the width.
Definition: qsize.h:126
QListView::Flow flow
Definition: qlistview_p.h:113
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
int height() const
Returns the height.
Definition: qsize.h:129
bool isValid() const
Returns true if both the width and height is equal to or greater than 0; otherwise returns false...
Definition: qsize.h:123
void reserve(int size)
Attempts to allocate memory for at least size elements.
Definition: qvector.h:339

◆ intersectingSet()

QVector< QModelIndex > QIconModeViewBase::intersectingSet ( const QRect area) const
virtual

Implements QCommonListViewBase.

Definition at line 3087 of file qlistview.cpp.

3088 {
3089  QIconModeViewBase *that = const_cast<QIconModeViewBase*>(this);
3090  QBspTree::Data data(static_cast<void*>(that));
3092  that->interSectingVector = &res;
3094  that->interSectingVector = 0;
3095  return res;
3096 }
static void addLeaf(QVector< int > &leaf, const QRect &area, uint visited, QBspTree::Data data)
Definition: qlistview.cpp:3146
static const char * data(const QByteArray &arr)
void climbTree(const QRect &rect, callback *function, QBspTreeData data)
Definition: qbsptree.cpp:71
QVector< QModelIndex > * interSectingVector
Definition: qlistview_p.h:263

◆ itemIndex()

int QIconModeViewBase::itemIndex ( const QListViewItem item) const
virtual

Implements QCommonListViewBase.

Definition at line 3110 of file qlistview.cpp.

3111 {
3112  if (!item.isValid())
3113  return -1;
3114  int i = item.indexHint;
3115  if (i < items.count()) {
3116  if (items.at(i) == item)
3117  return i;
3118  } else {
3119  i = items.count() - 1;
3120  }
3121 
3122  int j = i;
3123  int c = items.count();
3124  bool a = true;
3125  bool b = true;
3126 
3127  while (a || b) {
3128  if (a) {
3129  if (items.at(i) == item) {
3130  items.at(i).indexHint = i;
3131  return i;
3132  }
3133  a = ++i < c;
3134  }
3135  if (b) {
3136  if (items.at(j) == item) {
3137  items.at(j).indexHint = j;
3138  return j;
3139  }
3140  b = --j > -1;
3141  }
3142  }
3143  return -1;
3144 }
unsigned char c[8]
Definition: qnumeric_p.h:62
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
QVector< QListViewItem > items
Definition: qlistview_p.h:256
long ASN1_INTEGER_get ASN1_INTEGER * a
bool isValid() const
Definition: qlistview_p.h:86
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350

◆ itemsRect()

QRect QIconModeViewBase::itemsRect ( const QVector< QModelIndex > &  indexes) const
private

Definition at line 3098 of file qlistview.cpp.

3099 {
3101  QListViewItem item = indexToListViewItem(*it);
3102  QRect rect(item.x, item.y, item.w, item.h);
3103  for (; it != indexes.end(); ++it) {
3104  item = indexToListViewItem(*it);
3105  rect |= viewItemRect(item);
3106  }
3107  return rect;
3108 }
#define it(className, varName)
QListViewItem indexToListViewItem(const QModelIndex &index) const
Definition: qlistview.cpp:2904
The QVector class is a template class that provides a dynamic array.
Definition: qdatastream.h:64
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the vector...
Definition: qvector.h:250
iterator begin()
Returns an STL-style iterator pointing to the first item in the vector.
Definition: qvector.h:247
QRect viewItemRect(const QListViewItem &item) const
Definition: qlistview_p.h:473
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58

◆ moveItem()

void QIconModeViewBase::moveItem ( int  index,
const QPoint dest 
)
private

Definition at line 3166 of file qlistview.cpp.

3167 {
3168  // does not impact on the bintree itself or the contents rect
3169  QListViewItem *item = &items[index];
3170  QRect rect = item->rect();
3171 
3172  // move the item without removing it from the tree
3173  tree.removeLeaf(rect, index);
3174  item->move(dest);
3175  tree.insertLeaf(QRect(dest, rect.size()), index);
3176 
3177  // resize the contents area
3178  contentsSize = (QRect(QPoint(0, 0), contentsSize)|QRect(dest, rect.size())).size();
3179 
3180  // mark the item as moved
3181  if (moved.count() != items.count())
3182  moved.resize(items.count());
3183  moved.setBit(index, true);
3184 }
void insertLeaf(const QRect &r, int i)
Definition: qbsptree_p.h:97
void setBit(int i)
Sets the bit at index position i to 1.
Definition: qbitarray.h:128
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
QVector< QListViewItem > items
Definition: qlistview_p.h:256
QRect rect() const
Definition: qlistview_p.h:97
void move(const QPoint &position)
Definition: qlistview_p.h:92
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
void resize(int size)
Resizes the bit array to size bits.
Definition: qbitarray.cpp:214
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
int count() const
Same as size().
Definition: qbitarray.h:74
quint16 index
void removeLeaf(const QRect &r, int i)
Definition: qbsptree_p.h:98

◆ removeHiddenRow()

void QIconModeViewBase::removeHiddenRow ( int  row)
virtual

Reimplemented from QCommonListViewBase.

Definition at line 2737 of file qlistview.cpp.

2738 {
2740  if (row >= 0 && row < items.count()) //insert item
2741  tree.insertLeaf(items.at(row).rect(), row);
2742 }
void insertLeaf(const QRect &r, int i)
Definition: qbsptree_p.h:97
virtual void removeHiddenRow(int row)
Definition: qlistview.cpp:1918
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
QVector< QListViewItem > items
Definition: qlistview_p.h:256
QRect rect() const
Definition: qlistview_p.h:97
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350

◆ scrollContentsBy()

void QIconModeViewBase::scrollContentsBy ( int  dx,
int  dy,
bool  scrollElasticBand 
)
virtual

Reimplemented from QCommonListViewBase.

Definition at line 2869 of file qlistview.cpp.

2870 {
2871  if (scrollElasticBand)
2872  dd->scrollElasticBandBy(isRightToLeft() ? -dx : dx, dy);
2873 
2874  QCommonListViewBase::scrollContentsBy(dx, dy, scrollElasticBand);
2875  if (!draggedItems.isEmpty())
2876  viewport()->update(draggedItemsRect().translated(dx, dy));
2877 }
void update()
Updates the widget unless updates are disabled or the widget is hidden.
Definition: qwidget.cpp:10883
QRect draggedItemsRect() const
Definition: qlistview.cpp:3203
void scrollElasticBandBy(int dx, int dy)
Definition: qlistview.cpp:3210
QListViewPrivate * dd
Definition: qlistview_p.h:192
bool isRightToLeft() const
Definition: qlistview_p.h:483
bool isEmpty() const
Returns true if the vector has size 0; otherwise returns false.
Definition: qvector.h:139
QVector< QModelIndex > draggedItems
Definition: qlistview_p.h:259
QWidget * viewport() const
Definition: qlistview_p.h:469
virtual void scrollContentsBy(int dx, int dy, bool scrollElasticBand)
Definition: qlistview.cpp:1946

◆ setPositionForIndex()

void QIconModeViewBase::setPositionForIndex ( const QPoint position,
const QModelIndex index 
)
virtual

Reimplemented from QCommonListViewBase.

Definition at line 2717 of file qlistview.cpp.

2718 {
2719  if (index.row() >= items.count())
2720  return;
2721  const QSize oldContents = contentsSize;
2722  qq->update(index); // update old position
2723  moveItem(index.row(), position);
2724  qq->update(index); // update new position
2725 
2726  if (contentsSize != oldContents)
2727  dd->viewUpdateGeometries(); // update the scroll bars
2728 }
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
QVector< QListViewItem > items
Definition: qlistview_p.h:256
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
int row() const
Returns the row this model index refers to.
void moveItem(int index, const QPoint &dest)
Definition: qlistview.cpp:3166
QListViewPrivate * dd
Definition: qlistview_p.h:192
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
void update(const QModelIndex &index)
Updates the area occupied by the given index.

◆ setRowCount()

void QIconModeViewBase::setRowCount ( int  rowCount)
virtual

Implements QCommonListViewBase.

Definition at line 2864 of file qlistview.cpp.

2865 {
2866  tree.create(qMax(rowCount - hiddenCount(), 0));
2867 }
int rowCount() const
Definition: qlistview_p.h:466
int hiddenCount() const
Definition: qlistview_p.h:481
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
void create(int n, int d=-1)
Definition: qbsptree.cpp:48

◆ snapToGrid()

QPoint QIconModeViewBase::snapToGrid ( const QPoint pos) const
private

Definition at line 3186 of file qlistview.cpp.

3187 {
3188  int x = pos.x() - (pos.x() % gridSize().width());
3189  int y = pos.y() - (pos.y() % gridSize().height());
3190  return QPoint(x, y);
3191 }
int width() const
Returns the width.
Definition: qsize.h:126
QSize gridSize() const
Definition: qlistview_p.h:450
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
int height() const
Returns the height.
Definition: qsize.h:129
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128

◆ updateContentsSize()

void QIconModeViewBase::updateContentsSize ( )
private

Definition at line 3231 of file qlistview.cpp.

3232 {
3233  QRect bounding;
3234  for (int i = 0; i < items.count(); ++i)
3235  bounding |= items.at(i).rect();
3236  contentsSize = bounding.size();
3237 }
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
QVector< QListViewItem > items
Definition: qlistview_p.h:256
QRect rect() const
Definition: qlistview_p.h:97
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58

Properties

◆ draggedItems

QVector<QModelIndex> QIconModeViewBase::draggedItems

Definition at line 259 of file qlistview_p.h.

◆ draggedItemsPos

QPoint QIconModeViewBase::draggedItemsPos
mutable

Definition at line 260 of file qlistview_p.h.

◆ interSectingVector

QVector<QModelIndex>* QIconModeViewBase::interSectingVector

Definition at line 263 of file qlistview_p.h.

Referenced by addLeaf(), and intersectingSet().

◆ items

QVector<QListViewItem> QIconModeViewBase::items

Definition at line 256 of file qlistview_p.h.

Referenced by addLeaf().

◆ moved

QBitArray QIconModeViewBase::moved

Definition at line 257 of file qlistview_p.h.

◆ tree

QBspTree QIconModeViewBase::tree

Definition at line 255 of file qlistview_p.h.

Referenced by intersectingSet().


The documentation for this class was generated from the following files: