Qt 4.8
Public Functions | Public Variables | List of all members
QCommonListViewBase Class Referenceabstract

#include <qlistview_p.h>

Inheritance diagram for QCommonListViewBase:
QIconModeViewBase QListModeViewBase

Public Functions

virtual void appendHiddenRow (int row)
 
QSize cachedItemSize () const
 
virtual void clear ()=0
 
QRect clipRect () const
 
int column () const
 
virtual void dataChanged (const QModelIndex &, const QModelIndex &)=0
 
QAbstractItemDelegatedelegate (const QModelIndex &idx) const
 
virtual bool doBatchedItemLayout (const QListViewLayoutInfo &info, int max)=0
 
virtual bool filterDragLeaveEvent (QDragLeaveEvent *)
 
virtual bool filterDragMoveEvent (QDragMoveEvent *)
 
virtual bool filterDropEvent (QDropEvent *)
 
virtual bool filterStartDrag (Qt::DropActions)
 
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
 
virtual QListViewItem indexToListViewItem (const QModelIndex &index) const =0
 
virtual QVector< QModelIndexintersectingSet (const QRect &area) const =0
 
bool isHidden (int row) const
 
bool isRightToLeft () const
 
bool isWrapping () const
 
virtual int itemIndex (const QListViewItem &item) const =0
 
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)
 
virtual void removeHiddenRow (int row)
 
int rowCount () const
 
virtual void scrollContentsBy (int dx, int dy, bool scrollElasticBand)
 
virtual void setPositionForIndex (const QPoint &, const QModelIndex &)
 
virtual void setRowCount (int)=0
 
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

int batchSavedDeltaSeg
 
int batchStartRow
 
QSize contentsSize
 
QListViewPrivatedd
 
QListViewqq
 

Detailed Description

Definition at line 120 of file qlistview_p.h.

Constructors and Destructors

◆ QCommonListViewBase()

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

Definition at line 123 of file qlistview_p.h.

123 : dd(d), qq(q), batchStartRow(0), batchSavedDeltaSeg(0) {}
QListViewPrivate * dd
Definition: qlistview_p.h:192

◆ ~QCommonListViewBase()

virtual QCommonListViewBase::~QCommonListViewBase ( )
inlinevirtual

Definition at line 124 of file qlistview_p.h.

124 {}

Functions

◆ appendHiddenRow()

void QCommonListViewBase::appendHiddenRow ( int  row)
virtual

Reimplemented in QIconModeViewBase.

Definition at line 1913 of file qlistview.cpp.

Referenced by QIconModeViewBase::appendHiddenRow().

1914 {
1915  dd->hiddenRows.insert(dd->model->index(row, 0, qq->rootIndex()));
1916 }
QSet< QPersistentModelIndex > hiddenRows
Definition: qlistview_p.h:435
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...
const_iterator insert(const T &value)
Definition: qset.h:179
QListViewPrivate * dd
Definition: qlistview_p.h:192
QModelIndex rootIndex() const
Returns the model index of the model&#39;s root item.
QAbstractItemModel * model

◆ cachedItemSize()

QSize QCommonListViewBase::cachedItemSize ( ) const
inline

Definition at line 472 of file qlistview_p.h.

472 { return dd->cachedItemSize; }
QListViewPrivate * dd
Definition: qlistview_p.h:192

◆ clear()

virtual void QCommonListViewBase::clear ( )
pure virtual

Implemented in QIconModeViewBase, and QListModeViewBase.

Referenced by QListViewPrivate::clear().

◆ clipRect()

QRect QCommonListViewBase::clipRect ( ) const
inline

Definition at line 470 of file qlistview_p.h.

470 { return dd->clipRect(); }
QRect clipRect() const
Definition: qwidget.cpp:1997
QListViewPrivate * dd
Definition: qlistview_p.h:192

◆ column()

int QCommonListViewBase::column ( ) const
inline

Definition at line 457 of file qlistview_p.h.

457 { return dd->column; }
QListViewPrivate * dd
Definition: qlistview_p.h:192

◆ dataChanged()

virtual void QCommonListViewBase::dataChanged ( const QModelIndex ,
const QModelIndex  
)
pure virtual

Implemented in QIconModeViewBase, and QListModeViewBase.

◆ delegate()

QAbstractItemDelegate * QCommonListViewBase::delegate ( const QModelIndex idx) const
inline

Definition at line 477 of file qlistview_p.h.

478  { return dd->delegateForIndex(idx); }
QListViewPrivate * dd
Definition: qlistview_p.h:192
QAbstractItemDelegate * delegateForIndex(const QModelIndex &index) const

◆ doBatchedItemLayout()

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

◆ filterDragLeaveEvent()

virtual bool QCommonListViewBase::filterDragLeaveEvent ( QDragLeaveEvent )
inlinevirtual

Reimplemented in QIconModeViewBase.

Definition at line 152 of file qlistview_p.h.

Referenced by QIconModeViewBase::filterDragLeaveEvent().

152 { return false; }

◆ filterDragMoveEvent()

virtual bool QCommonListViewBase::filterDragMoveEvent ( QDragMoveEvent )
inlinevirtual

Reimplemented in QIconModeViewBase.

Definition at line 151 of file qlistview_p.h.

151 { return false; }

◆ filterDropEvent()

virtual bool QCommonListViewBase::filterDropEvent ( QDropEvent )
inlinevirtual

Reimplemented in QIconModeViewBase.

Definition at line 153 of file qlistview_p.h.

153 { return false; }

◆ filterStartDrag()

virtual bool QCommonListViewBase::filterStartDrag ( Qt::DropActions  )
inlinevirtual

Reimplemented in QIconModeViewBase.

Definition at line 154 of file qlistview_p.h.

154 { return false; }

◆ flow()

QListView::Flow QCommonListViewBase::flow ( ) const
inline

Definition at line 451 of file qlistview_p.h.

451 { return dd->flow; }
QListViewPrivate * dd
Definition: qlistview_p.h:192
QListView::Flow flow
Definition: qlistview_p.h:409

◆ gridSize()

QSize QCommonListViewBase::gridSize ( ) const
inline

Definition at line 450 of file qlistview_p.h.

450 { return dd->gridSize(); }
QSize gridSize() const
Definition: qlistview_p.h:369
QListViewPrivate * dd
Definition: qlistview_p.h:192

◆ hiddenCount()

int QCommonListViewBase::hiddenCount ( ) const
inline

Definition at line 481 of file qlistview_p.h.

481 { return dd->hiddenRows.count(); }
QSet< QPersistentModelIndex > hiddenRows
Definition: qlistview_p.h:435
int count() const
Definition: qset.h:178
QListViewPrivate * dd
Definition: qlistview_p.h:192

◆ horizontalOffset()

int QCommonListViewBase::horizontalOffset ( ) const
virtual

Reimplemented in QListModeViewBase.

Definition at line 1965 of file qlistview.cpp.

Referenced by QListModeViewBase::horizontalOffset().

1966 {
1967  return (isRightToLeft() ? horizontalScrollBar()->maximum() - horizontalScrollBar()->value() : horizontalScrollBar()->value());
1968 }
QScrollBar * horizontalScrollBar() const
Definition: qlistview_p.h:460
bool isRightToLeft() const
Definition: qlistview_p.h:483

◆ horizontalScrollBar()

QScrollBar * QCommonListViewBase::horizontalScrollBar ( ) const
inline

Definition at line 460 of file qlistview_p.h.

460 { return qq->horizontalScrollBar(); }
QScrollBar * horizontalScrollBar() const
Returns the horizontal scroll bar.

◆ horizontalScrollMode()

QListView::ScrollMode QCommonListViewBase::horizontalScrollMode ( ) const
inline

Definition at line 462 of file qlistview_p.h.

462 { return qq->horizontalScrollMode(); }
ScrollMode horizontalScrollMode() const

◆ horizontalScrollToValue()

int QCommonListViewBase::horizontalScrollToValue ( int  index,
QListView::ScrollHint  hint,
bool  leftOf,
bool  rightOf,
const QRect area,
const QRect rect 
) const
virtual

Reimplemented in QListModeViewBase.

Definition at line 1970 of file qlistview.cpp.

Referenced by QListModeViewBase::horizontalScrollToValue().

1972 {
1973  int horizontalValue = horizontalScrollBar()->value();
1974  if (isRightToLeft()) {
1975  if (hint == QListView::PositionAtCenter) {
1976  horizontalValue += ((area.width() - rect.width()) / 2) - rect.left();
1977  } else {
1978  if (leftOf)
1979  horizontalValue -= rect.left();
1980  else if (rightOf)
1981  horizontalValue += qMin(rect.left(), area.width() - rect.right());
1982  }
1983  } else {
1984  if (hint == QListView::PositionAtCenter) {
1985  horizontalValue += rect.left() - ((area.width()- rect.width()) / 2);
1986  } else {
1987  if (leftOf)
1988  horizontalValue += rect.left();
1989  else if (rightOf)
1990  horizontalValue += qMin(rect.left(), rect.right() - area.width());
1991  }
1992  }
1993  return horizontalValue;
1994 }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
int value() const
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246
QScrollBar * horizontalScrollBar() const
Definition: qlistview_p.h:460
bool isRightToLeft() const
Definition: qlistview_p.h:483

◆ indexToListViewItem()

virtual QListViewItem QCommonListViewBase::indexToListViewItem ( const QModelIndex index) const
pure virtual

◆ intersectingSet()

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

Implemented in QIconModeViewBase, and QListModeViewBase.

◆ isHidden()

bool QCommonListViewBase::isHidden ( int  row) const
inline

Definition at line 480 of file qlistview_p.h.

480 { return dd->isHidden(row); }
bool isHidden(int row) const
Definition: qlistview_p.h:378
QListViewPrivate * dd
Definition: qlistview_p.h:192

◆ isRightToLeft()

bool QCommonListViewBase::isRightToLeft ( ) const
inline

Definition at line 483 of file qlistview_p.h.

483 { return qq->isRightToLeft(); }
bool isRightToLeft() const
Definition: qwidget.h:428

◆ isWrapping()

bool QCommonListViewBase::isWrapping ( ) const
inline

Definition at line 449 of file qlistview_p.h.

449 { return dd->isWrapping(); }
bool isWrapping() const
Definition: qlistview_p.h:371
QListViewPrivate * dd
Definition: qlistview_p.h:192

◆ itemIndex()

virtual int QCommonListViewBase::itemIndex ( const QListViewItem item) const
pure virtual

Implemented in QIconModeViewBase, and QListModeViewBase.

◆ itemSize()

QSize QCommonListViewBase::itemSize ( const QStyleOptionViewItemV2 opt,
const QModelIndex idx 
) const
inline

Definition at line 474 of file qlistview_p.h.

475  { return dd->itemSize(opt, idx); }
QSize itemSize(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: qlistview.cpp:1847
QListViewPrivate * dd
Definition: qlistview_p.h:192

◆ mapToViewport()

virtual QRect QCommonListViewBase::mapToViewport ( const QRect rect) const
inlinevirtual

Reimplemented in QListModeViewBase.

Definition at line 140 of file qlistview_p.h.

Referenced by QListViewPrivate::mapToViewport().

140 {return rect;}

◆ modelIndex()

QModelIndex QCommonListViewBase::modelIndex ( int  row) const
inline

Definition at line 464 of file qlistview_p.h.

465  { return dd->model->index(row, dd->column, dd->root); }
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...
QPersistentModelIndex root
QListViewPrivate * dd
Definition: qlistview_p.h:192
QAbstractItemModel * model

◆ movement()

QListView::Movement QCommonListViewBase::movement ( ) const
inline

Definition at line 452 of file qlistview_p.h.

452 { return dd->movement; }
QListView::Movement movement
Definition: qlistview_p.h:410
QListViewPrivate * dd
Definition: qlistview_p.h:192

◆ offset()

QPoint QCommonListViewBase::offset ( ) const
inline

Definition at line 454 of file qlistview_p.h.

454 { return dd->offset(); }
QListViewPrivate * dd
Definition: qlistview_p.h:192

◆ paintDragDrop()

void QCommonListViewBase::paintDragDrop ( QPainter painter)

Definition at line 1924 of file qlistview.cpp.

1925 {
1926  // FIXME: Until the we can provide a proper drop indicator
1927  // in IconMode, it makes no sense to show it
1928  dd->paintDropIndicator(painter);
1929 }
QListViewPrivate * dd
Definition: qlistview_p.h:192
void paintDropIndicator(QPainter *painter)

◆ pressedPosition()

QPoint QCommonListViewBase::pressedPosition ( ) const
inline

Definition at line 455 of file qlistview_p.h.

455 { return dd->pressedPosition; }
QListViewPrivate * dd
Definition: qlistview_p.h:192

◆ removeHiddenRow()

void QCommonListViewBase::removeHiddenRow ( int  row)
virtual

Reimplemented in QIconModeViewBase.

Definition at line 1918 of file qlistview.cpp.

Referenced by QIconModeViewBase::removeHiddenRow().

1919 {
1920  dd->hiddenRows.remove(dd->model->index(row, 0, qq->rootIndex()));
1921 }
bool remove(const T &value)
Definition: qset.h:89
QSet< QPersistentModelIndex > hiddenRows
Definition: qlistview_p.h:435
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...
QListViewPrivate * dd
Definition: qlistview_p.h:192
QModelIndex rootIndex() const
Returns the model index of the model&#39;s root item.
QAbstractItemModel * model

◆ rowCount()

int QCommonListViewBase::rowCount ( ) const
inline

Definition at line 466 of file qlistview_p.h.

466 { return dd->model->rowCount(dd->root); }
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
QPersistentModelIndex root
QListViewPrivate * dd
Definition: qlistview_p.h:192
QAbstractItemModel * model

◆ scrollContentsBy()

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

Reimplemented in QIconModeViewBase, and QListModeViewBase.

Definition at line 1946 of file qlistview.cpp.

Referenced by QListModeViewBase::scrollContentsBy(), and QIconModeViewBase::scrollContentsBy().

1947 {
1948  dd->scrollContentsBy(isRightToLeft() ? -dx : dx, dy);
1949 }
void scrollContentsBy(int dx, int dy)
QListViewPrivate * dd
Definition: qlistview_p.h:192
bool isRightToLeft() const
Definition: qlistview_p.h:483

◆ setPositionForIndex()

virtual void QCommonListViewBase::setPositionForIndex ( const QPoint ,
const QModelIndex  
)
inlinevirtual

Reimplemented in QIconModeViewBase.

Definition at line 147 of file qlistview_p.h.

147 { }

◆ setRowCount()

virtual void QCommonListViewBase::setRowCount ( int  )
pure virtual

◆ spacing()

int QCommonListViewBase::spacing ( ) const
inline

Definition at line 448 of file qlistview_p.h.

448 { return dd->spacing(); }
int spacing() const
Definition: qlistview_p.h:373
QListViewPrivate * dd
Definition: qlistview_p.h:192

◆ uniformItemSizes()

bool QCommonListViewBase::uniformItemSizes ( ) const
inline

Definition at line 456 of file qlistview_p.h.

456 { return dd->uniformItemSizes; }
QListViewPrivate * dd
Definition: qlistview_p.h:192

◆ updateHorizontalScrollBar()

void QCommonListViewBase::updateHorizontalScrollBar ( const QSize step)
virtual

Reimplemented in QListModeViewBase.

Definition at line 1932 of file qlistview.cpp.

Referenced by QListModeViewBase::updateHorizontalScrollBar().

1933 {
1935  horizontalScrollBar()->setPageStep(viewport()->width());
1937 }
int width
the width of the widget excluding any window frame
Definition: qwidget.h:166
void setRange(int min, int max)
Sets the slider&#39;s minimum to min and its maximum to max.
int width() const
Returns the width.
Definition: qsize.h:126
QScrollBar * horizontalScrollBar() const
Definition: qlistview_p.h:460
int spacing() const
Definition: qlistview_p.h:448
QWidget * viewport() const
Definition: qlistview_p.h:469

◆ updateVerticalScrollBar()

void QCommonListViewBase::updateVerticalScrollBar ( const QSize step)
virtual

Reimplemented in QListModeViewBase.

Definition at line 1939 of file qlistview.cpp.

Referenced by QListModeViewBase::updateVerticalScrollBar().

1940 {
1942  verticalScrollBar()->setPageStep(viewport()->height());
1944 }
void setRange(int min, int max)
Sets the slider&#39;s minimum to min and its maximum to max.
int height
the height of the widget excluding any window frame
Definition: qwidget.h:167
int spacing() const
Definition: qlistview_p.h:448
int height() const
Returns the height.
Definition: qsize.h:129
QScrollBar * verticalScrollBar() const
Definition: qlistview_p.h:459
QWidget * viewport() const
Definition: qlistview_p.h:469

◆ verticalOffset()

virtual int QCommonListViewBase::verticalOffset ( ) const
inlinevirtual

Reimplemented in QListModeViewBase.

Definition at line 142 of file qlistview_p.h.

Referenced by QListModeViewBase::verticalOffset().

142 { return verticalScrollBar()->value(); }
int value() const
QScrollBar * verticalScrollBar() const
Definition: qlistview_p.h:459

◆ verticalScrollBar()

QScrollBar * QCommonListViewBase::verticalScrollBar ( ) const
inline

Definition at line 459 of file qlistview_p.h.

459 { return qq->verticalScrollBar(); }
QScrollBar * verticalScrollBar() const
Returns the vertical scroll bar.

◆ verticalScrollMode()

QListView::ScrollMode QCommonListViewBase::verticalScrollMode ( ) const
inline

Definition at line 461 of file qlistview_p.h.

461 { return qq->verticalScrollMode(); }
ScrollMode verticalScrollMode() const

◆ verticalScrollToValue()

int QCommonListViewBase::verticalScrollToValue ( int  index,
QListView::ScrollHint  hint,
bool  above,
bool  below,
const QRect area,
const QRect rect 
) const
virtual

Reimplemented in QListModeViewBase.

Definition at line 1951 of file qlistview.cpp.

Referenced by QListModeViewBase::verticalScrollToValue().

1953 {
1954  int verticalValue = verticalScrollBar()->value();
1955  QRect adjusted = rect.adjusted(-spacing(), -spacing(), spacing(), spacing());
1956  if (hint == QListView::PositionAtTop || above)
1957  verticalValue += adjusted.top();
1958  else if (hint == QListView::PositionAtBottom || below)
1959  verticalValue += qMin(adjusted.top(), adjusted.bottom() - area.height() + 1);
1960  else if (hint == QListView::PositionAtCenter)
1961  verticalValue += adjusted.top() - ((area.height() - adjusted.height()) / 2);
1962  return verticalValue;
1963 }
QRect adjusted(int x1, int y1, int x2, int y2) const
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
Definition: qrect.h:431
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
int value() const
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
int spacing() const
Definition: qlistview_p.h:448
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QScrollBar * verticalScrollBar() const
Definition: qlistview_p.h:459

◆ viewItemRect()

QRect QCommonListViewBase::viewItemRect ( const QListViewItem item) const
inline

Definition at line 473 of file qlistview_p.h.

473 { return dd->viewItemRect(item); }
QRect viewItemRect(const QListViewItem &item) const
Definition: qlistview_p.h:331
QListViewPrivate * dd
Definition: qlistview_p.h:192

◆ viewOptions()

QStyleOptionViewItemV4 QCommonListViewBase::viewOptions ( ) const
inline

Definition at line 468 of file qlistview_p.h.

468 { return dd->viewOptionsV4(); }
QListViewPrivate * dd
Definition: qlistview_p.h:192
QStyleOptionViewItemV4 viewOptionsV4() const

◆ viewport()

QWidget * QCommonListViewBase::viewport ( ) const
inline

Definition at line 469 of file qlistview_p.h.

469 { return dd->viewport; }
QListViewPrivate * dd
Definition: qlistview_p.h:192

Properties

◆ batchSavedDeltaSeg

int QCommonListViewBase::batchSavedDeltaSeg

Definition at line 196 of file qlistview_p.h.

◆ batchStartRow

int QCommonListViewBase::batchStartRow

Definition at line 195 of file qlistview_p.h.

◆ contentsSize

QSize QCommonListViewBase::contentsSize

Definition at line 194 of file qlistview_p.h.

◆ dd

QListViewPrivate* QCommonListViewBase::dd

Definition at line 192 of file qlistview_p.h.

Referenced by QIconModeViewBase::addLeaf().

◆ qq

QListView* QCommonListViewBase::qq

Definition at line 193 of file qlistview_p.h.


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