56 #include "private/qabstractitemview_p.h" 63 #ifndef QT_NO_LISTVIEW 76 :
x(other.
x),
y(other.
y),
w(other.
w),
h(other.
h),
82 return (
x == other.
x &&
y == other.
y &&
w == other.
w &&
h == other.
h &&
85 {
return !(*
this == other); }
89 {
x = -1;
y = -1;
w = 0;
h = 0; }
93 {
x = position.
x();
y = position.
y(); }
94 inline int width()
const {
return w; }
130 virtual void clear() = 0;
131 virtual void setRowCount(
int) = 0;
136 bool leftOf,
bool rightOf,
const QRect &area,
const QRect &
rect)
const;
138 bool above,
bool below,
const QRect &area,
const QRect &rect)
const;
139 virtual void scrollContentsBy(
int dx,
int dy,
bool scrollElasticBand);
141 virtual int horizontalOffset()
const;
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);
149 #ifndef QT_NO_DRAGANDDROP 150 void paintDragDrop(
QPainter *painter);
159 inline int spacing()
const;
160 inline bool isWrapping()
const;
161 inline QSize gridSize()
const;
165 inline QPoint offset()
const;
166 inline QPoint pressedPosition()
const;
167 inline bool uniformItemSizes()
const;
168 inline int column()
const;
171 inline QScrollBar *horizontalScrollBar()
const;
176 inline int rowCount()
const;
179 inline QWidget *viewport()
const;
180 inline QRect clipRect()
const;
182 inline QSize cachedItemSize()
const;
187 inline bool isHidden(
int row)
const;
188 inline int hiddenCount()
const;
190 inline bool isRightToLeft()
const;
223 bool leftOf,
bool rightOf,
const QRect &area,
const QRect &
rect)
const;
225 bool above,
bool below,
const QRect &area,
const QRect &rect)
const;
226 void scrollContentsBy(
int dx,
int dy,
bool scrollElasticBand);
228 int horizontalOffset()
const;
229 int verticalOffset()
const;
230 void updateHorizontalScrollBar(
const QSize &step);
231 void updateVerticalScrollBar(
const QSize &step);
233 #ifndef QT_NO_DRAGANDDROP 244 int perItemScrollToValue(
int index,
int value,
int height,
247 int perItemScrollingPageSteps(
int length,
int bounds,
bool wrap)
const;
270 void setRowCount(
int rowCount);
273 void scrollContentsBy(
int dx,
int dy,
bool scrollElasticBand);
275 void appendHiddenRow(
int row);
276 void removeHiddenRow(
int row);
279 #ifndef QT_NO_DRAGANDDROP 283 bool filterStartDrag(Qt::DropActions);
287 void initBspTree(
const QSize &contents);
293 QRect draggedItemsRect()
const;
295 void updateContentsSize();
296 QPoint draggedItemsDelta()
const;
310 void prepareItemsLayout();
312 bool doItemsLayout(
int num);
315 if (doLayout) executePostedLayout();
317 return commonListView->intersectingSet(a);
326 {
return qMax(viewport->width(), contentsSize().width()) - x; }
328 {
return QPoint(flipX(p.
x()), p.
y()); }
332 {
if (q_func()->isRightToLeft())
return flipX(item.
rect());
return item.
rect(); }
336 {
return model->index(commonListView->itemIndex(item), column, root); }
340 if (!isIndexValid(index) || index.
parent() != root || index.
column() != column || isHidden(index.
row()))
342 executePostedLayout();
343 return viewItemRect(indexToListViewItem(index));
361 void selectAll(QItemSelectionModel::SelectionFlags command);
363 #ifndef QT_NO_DRAGANDDROP 380 return isPersistent(idx) && hiddenRows.contains(idx);
382 inline bool isHiddenOrDisabled(
int row)
const {
return isHidden(row) || !isIndexEnabled(modelIndex(row)); }
386 while (it != indexes->
end()) {
387 if (!isIndexEnabled(*it) || (*it) == current)
394 void scrollElasticBandBy(
int dx,
int dy);
424 SelectionRectVisible = 64
465 {
return dd->
model->
index(row, dd->column, dd->root); }
475 {
return dd->itemSize(opt, idx); }
478 {
return dd->delegateForIndex(idx); }
487 #endif // QT_NO_LISTVIEW 489 #endif // QLISTVIEW_P_H The QPainter class performs low-level painting on widgets and other paint devices.
void setContentsSize(int w, int h)
void setGridSize(const QSize &size)
The QAbstractItemDelegate class is used to display and edit data items from a model.
QRect flipX(const QRect &r) const
void setRowCount(int rowCount)
static mach_timebase_info_data_t info
QPoint pressedPosition() const
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
QVector< int > segmentStartRows
#define QT_END_NAMESPACE
This macro expands to.
virtual ~QCommonListViewBase()
#define it(className, varName)
QVector< int > segmentPositions
QIconModeViewBase(QListView *q, QListViewPrivate *d)
bool uniformItemSizes() const
QVector< int > flowPositions
bool isHiddenOrDisabled(int row) const
virtual bool filterDropEvent(QDropEvent *)
QPoint flipX(const QPoint &p) const
QVector< QListViewItem > items
QRect rectForIndex(const QModelIndex &index) const
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
QListView::ViewMode viewMode
The QStyleOptionViewItemV4 class is used to describe the parameters necessary for drawing a frame in ...
QRect normalized() const
Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height...
static void clear(QVariant::Private *d)
virtual void setPositionForIndex(const QPoint &, const QModelIndex &)
QModelIndex modelIndex(int row) const
int width() const
Returns the width of the rectangle.
virtual QRect mapToViewport(const QRect &rect) const
QSize cachedItemSize() const
QListView::LayoutMode layoutMode
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
int height() const
Returns the height of the rectangle.
QListView::ScrollMode horizontalScrollMode() const
The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress...
QListView::Flow flow() const
virtual bool filterDragMoveEvent(QDragMoveEvent *)
QVector< QModelIndex > intersectingSet(const QRect &area, bool doLayout=true) const
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
virtual bool filterStartDrag(Qt::DropActions)
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
void resize(int size)
Sets the size of the vector to size.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the vector...
The QStyleOptionViewItemV2 class is used to describe the parameters necessary for drawing a frame in ...
bool isHidden(int row) const
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.
#define QT_BEGIN_NAMESPACE
This macro expands to.
bool isHidden(int row) const
QListView::Movement movement() const
QRect viewItemRect(const QListViewItem &item) const
QSize itemSize(const QStyleOptionViewItemV2 &opt, const QModelIndex &idx) const
virtual bool filterDragLeaveEvent(QDragLeaveEvent *)
QVector< int > scrollValueMap
int row() const
Returns the row this model index refers to.
void move(const QPoint &position)
bool operator!=(const QListViewItem &other) const
void removeCurrentAndDisabled(QVector< QModelIndex > *indexes, const QModelIndex ¤t) const
const QAbstractItemModel * model() const
Returns a pointer to the model containing the item that this index refers to.
bool selectionAllowed(const QModelIndex &index) const
QBasicTimer batchLayoutTimer
static const char * data(const QByteArray &arr)
void emitIndexesMoved(const QModelIndexList &indexes)
QAbstractItemDelegate * delegate(const QModelIndex &idx) const
The QDragLeaveEvent class provides an event that is sent to a widget when a drag and drop action leav...
QVector< int > segmentExtents
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
virtual int verticalOffset() const
The QBitArray class provides an array of bits.
QListView::Movement movement
QCommonListViewBase(QListView *q, QListViewPrivate *d)
#define Q_DECLARE_PUBLIC(Class)
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...
The QListView class provides a list or icon view onto a model.
QScrollBar * horizontalScrollBar() const
QCommonListViewBase * commonListView
iterator begin()
Returns an STL-style iterator pointing to the first item in the vector.
int y() const
Returns the y-coordinate of the rectangle's top edge.
The Flow item arranges its children side by side, wrapping as necessary.
bool isSelectionRectVisible() const
int x() const
Returns the x-coordinate of the rectangle's left edge.
QRect viewItemRect(const QListViewItem &item) const
QModelIndex modelIndex(int row) const
iterator erase(iterator begin, iterator end)
Removes all the items from begin up to (but not including) end.
The QPoint class defines a point in the plane using integer precision.
The QModelIndex class is used to locate data in a data model.
int height() const
Returns the height.
The QRect class defines a rectangle in the plane using integer precision.
QVector< QModelIndex > * interSectingVector
bool isRightToLeft() const
QListModeViewBase(QListView *q, QListViewPrivate *d)
friend class QListViewPrivate
int batchStartRow() const
int y() const
Returns the y coordinate of this point.
The QBasicTimer class provides timer events for objects.
The QSize class defines the size of a two-dimensional object using integer point precision.
void viewUpdateGeometries()
QScrollBar * verticalScrollBar() const
int x() const
Returns the x coordinate of this point.
The QStyleOptionViewItem class is used to describe the parameters used to draw an item in a view widg...
bool operator==(const QListViewItem &other) const
void setSelectionRectVisible(bool visible)
bool isValid() const
Returns true if the rectangle is valid, otherwise returns false.
QVector< QModelIndex > draggedItems
QModelIndex listViewItemToIndex(const QListViewItem &item) const
int itemIndex(const QListViewItem &item) const
QListViewItem(QRect r, int i)
QListView::ScrollMode verticalScrollMode() const
void resize(const QSize &size)
void resetBatchStartRow()
QListViewItem(const QListViewItem &other)
QWidget * viewport() const
QListView::ResizeMode resizeMode
int column() const
Returns the column this model index refers to.
The QList class is a template class that provides lists.
static int area(const QSize &s)
QSize contentsSize() const
QStyleOptionViewItemV4 viewOptions() const