Qt 4.8
Public Functions | Public Variables | List of all members
FxListItem Class Reference

Public Functions

bool contains (qreal x, qreal y) const
 
qreal endPosition () const
 
 FxListItem (QDeclarativeItem *i, QDeclarativeListView *v)
 
qreal itemPosition () const
 
qreal itemSize () const
 
qreal position () const
 
qreal sectionSize () const
 
void setPosition (qreal pos)
 
void setSize (qreal size)
 
qreal size () const
 
 ~FxListItem ()
 

Public Variables

QDeclarativeListViewAttachedattached
 
int index
 
QDeclarativeItemitem
 
QDeclarativeItemsection
 
QDeclarativeListViewview
 

Detailed Description

Definition at line 98 of file qdeclarativelistview.cpp.

Constructors and Destructors

◆ FxListItem()

FxListItem::FxListItem ( QDeclarativeItem i,
QDeclarativeListView v 
)
inline

Definition at line 101 of file qdeclarativelistview.cpp.

101  : item(i), section(0), view(v) {
102  attached = static_cast<QDeclarativeListViewAttached*>(qmlAttachedPropertiesObject<QDeclarativeListView>(item));
103  if (attached)
105  }
void setView(QDeclarativeListView *view)
QDeclarativeItem * item
QDeclarativeListViewAttached * attached
QDeclarativeListView * view
QDeclarativeItem * section

◆ ~FxListItem()

FxListItem::~FxListItem ( )
inline

Definition at line 106 of file qdeclarativelistview.cpp.

106 {}

Functions

◆ contains()

bool FxListItem::contains ( qreal  x,
qreal  y 
) const
inline

Definition at line 176 of file qdeclarativelistview.cpp.

Referenced by QDeclarativeListView::indexAt().

176  {
177  return (x >= item->x() && x < item->x() + item->width() &&
178  y >= item->y() && y < item->y() + item->height());
179  }
QDeclarativeItem * item
qreal y() const
This convenience function is equivalent to calling pos().
qreal x() const
This convenience function is equivalent to calling pos().

◆ endPosition()

qreal FxListItem::endPosition ( ) const
inline

Definition at line 138 of file qdeclarativelistview.cpp.

Referenced by QDeclarativeListViewPrivate::endPositionAt(), QDeclarativeListViewPrivate::firstVisibleItem(), QDeclarativeListViewPrivate::positionViewAtIndex(), QDeclarativeListViewPrivate::refill(), and QDeclarativeListViewPrivate::snapItemAt().

138  {
140  return item->y() + (item->height() >= 1.0 ? item->height() : 1) - 1;
141  } else {
143  ? -item->width()-item->x() + (item->width() >= 1.0 ? item->width() : 1)
144  : item->x() + (item->width() >= 1.0 ? item->width() : 1)) - 1;
145  }
146  }
Qt::LayoutDirection effectiveLayoutDirection() const
QDeclarativeItem * item
qreal y() const
This convenience function is equivalent to calling pos().
qreal x() const
This convenience function is equivalent to calling pos().
QDeclarativeListView * view

◆ itemPosition()

qreal FxListItem::itemPosition ( ) const
inline

Definition at line 118 of file qdeclarativelistview.cpp.

118  {
120  return item->y();
121  else
122  return (view->effectiveLayoutDirection() == Qt::RightToLeft ? -item->width()-item->x() : item->x());
123  }
Qt::LayoutDirection effectiveLayoutDirection() const
QDeclarativeItem * item
qreal y() const
This convenience function is equivalent to calling pos().
qreal x() const
This convenience function is equivalent to calling pos().
QDeclarativeListView * view

◆ itemSize()

qreal FxListItem::itemSize ( ) const
inline

Definition at line 130 of file qdeclarativelistview.cpp.

◆ position()

qreal FxListItem::position ( ) const
inline

Definition at line 107 of file qdeclarativelistview.cpp.

Referenced by QDeclarativeListViewPrivate::createSection(), QDeclarativeListViewPrivate::fixup(), QDeclarativeListView::itemsInserted(), QDeclarativeListView::itemsMoved(), QDeclarativeListView::itemsRemoved(), QDeclarativeListViewPrivate::positionAt(), QDeclarativeListViewPrivate::positionViewAtIndex(), QDeclarativeListViewPrivate::refill(), and QDeclarativeListViewPrivate::snapItemAt().

107  {
108  if (section) {
110  return section->y();
111  else
113  } else {
114  return itemPosition();
115  }
116  }
Qt::LayoutDirection effectiveLayoutDirection() const
qreal itemPosition() const
qreal y() const
This convenience function is equivalent to calling pos().
qreal x() const
This convenience function is equivalent to calling pos().
QDeclarativeListView * view
QDeclarativeItem * section

◆ sectionSize()

qreal FxListItem::sectionSize ( ) const
inline

Definition at line 133 of file qdeclarativelistview.cpp.

133  {
134  if (section)
136  return 0.0;
137  }
QDeclarativeListView * view
QDeclarativeItem * section

◆ setPosition()

void FxListItem::setPosition ( qreal  pos)
inline

Definition at line 147 of file qdeclarativelistview.cpp.

Referenced by QDeclarativeListViewPrivate::createSection(), QDeclarativeListView::itemsInserted(), QDeclarativeListView::itemsMoved(), QDeclarativeListViewPrivate::layout(), and QDeclarativeListViewPrivate::refill().

147  {
149  if (section) {
150  section->setY(pos);
151  pos += section->height();
152  }
153  item->setY(pos);
154  } else {
156  if (section) {
157  section->setX(-section->width()-pos);
158  pos += section->width();
159  }
160  item->setX(-item->width()-pos);
161  } else {
162  if (section) {
163  section->setX(pos);
164  pos += section->width();
165  }
166  item->setX(pos);
167  }
168  }
169  }
Qt::LayoutDirection effectiveLayoutDirection() const
QDeclarativeItem * item
void setX(qreal x)
Set&#39;s the x coordinate of the item&#39;s position.
void setY(qreal y)
Set&#39;s the y coordinate of the item&#39;s position.
QDeclarativeListView * view
QDeclarativeItem * section

◆ setSize()

void FxListItem::setSize ( qreal  size)
inline

Definition at line 170 of file qdeclarativelistview.cpp.

170  {
172  item->setHeight(size);
173  else
174  item->setWidth(size);
175  }
QDeclarativeItem * item
QDeclarativeListView * view
qreal size() const

◆ size()

qreal FxListItem::size ( ) const
inline

Properties

◆ attached

QDeclarativeListViewAttached* FxListItem::attached

◆ index

int FxListItem::index

◆ item

QDeclarativeItem* FxListItem::item

◆ section

QDeclarativeItem* FxListItem::section

◆ view

QDeclarativeListView* FxListItem::view

Definition at line 183 of file qdeclarativelistview.cpp.


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