--- a/src/hbwidgets/itemviews/hbabstractitemview.cpp Fri Jun 11 13:58:22 2010 +0300
+++ b/src/hbwidgets/itemviews/hbabstractitemview.cpp Wed Jun 23 18:33:25 2010 +0300
@@ -23,10 +23,10 @@
**
****************************************************************************/
+#include "hbabstractitemview.h"
#include "hbabstractitemview_p.h"
#include "hbabstractitemcontainer_p_p.h"
-#include <hbabstractitemview.h>
#include <hbabstractviewitem.h>
#include <hbevent.h>
#include <hbabstractitemcontainer_p.h>
@@ -76,7 +76,7 @@
\fn void HbAbstractItemView::pressed(const QModelIndex &index)
This signal is emitted when a touch down event is received within
- Abstract view item that is representing \a index.
+ view item that is representing \a index.
See also released() and activated().
*/
@@ -84,10 +84,11 @@
/*!
\fn void HbAbstractItemView::released(const QModelIndex &index)
- This signal is emitted when a touch release event is received within
+ This signal is emitted when a release event is received within
Abstract view item that is representing \a index.
See also pressed() and activated().
+ \sa HbAbstractViewItem::released(const QPointF &position)
*/
/*!
@@ -137,18 +138,58 @@
*/
/*!
+ \enum HbAbstractItemView::ScrollHint
+
+ Enumeration specifies positions on the view, onto which an item can be scrolled.
+
+ \sa scrollTo(const QModelIndex &index, HbAbstractItemView::ScrollHint hint = EnsureVisible)
+*/
+
+/*!
+ \var HbAbstractItemView::EnsureVisible
+
+ Item will be fully visible somewhere on the view.
+*/
+
+
+/*!
+ \var HbAbstractItemView::PositionAtTop
+
+ Item will be fully visible as topmost item.
+*/
+
+
+/*!
+ \var HbAbstractItemView::PositionAtBottom
+
+ Item will be fully visible as bottommost item.
+*/
+
+/*!
+ \var HbAbstractItemView::PositionAtCenter
+
+ Item will be centered.
+*/
+
+/*!
\enum HbAbstractItemView::ItemAnimation
animations in HbAbstractItemView that can be disabled. By default all animations are enabled.
*/
/*!
+ \var HbAbstractItemView::None
+
+ Any animation is not applied.
+*/
+
+/*!
\var HbAbstractItemView::Appear
Animation related to item appearance. Disable this animation in cases you expect many model items to appear,
- for example in case like insertion of a new data source, and you do not wish to see animations.
-
- Note that the item appearance animations are not used directly after a setModel call to force non-animated model change.
+ for example in case like insertion of a new data source, and you do not wish to see animations.
+
+ Note that the item appearance animations are not used directly after a setModel call to force non-animated model change.
*/
/*!
@@ -177,6 +218,12 @@
*/
/*!
+ \var HbAbstractItemView::All
+
+ Every animation is applied.
+*/
+
+/*!
Here are the main properties of the class:
\li HbAbstractItemView::itemRecycling: ItemRecycling.
@@ -192,6 +239,8 @@
Scrolls the view if necessary to ensure that the item at \a index is visible
in a position according to \a hint. Default value just guarantees, that item will be fully visible.
+
+ Scrolling is not animated but movement is immediate.
*/
@@ -233,7 +282,7 @@
/*!
Destructs the abstract item view.
- */
+*/
HbAbstractItemView::~HbAbstractItemView()
{
@@ -254,7 +303,7 @@
If no prototype has been passed, default prototype is used.
Note! Itemview may create view items asynchronously.
- */
+*/
void HbAbstractItemView::setModel(QAbstractItemModel *model, HbAbstractViewItem *prototype)
{
Q_D(HbAbstractItemView);
@@ -333,7 +382,7 @@
Sets the current selection model to \a selectionModel.
Note: If setModel() is called after this function, the given selectionModel will be
replaced by default selection model of the view.
- */
+*/
void HbAbstractItemView::setSelectionModel(QItemSelectionModel *selectionModel)
{
Q_D(HbAbstractItemView);
@@ -346,7 +395,7 @@
/*!
If \a newMode is not same as current selection mode of view,
updates selection mode, all viewitems and clears all existing selections.
- */
+*/
void HbAbstractItemView::setSelectionMode(SelectionMode newMode)
{
Q_D(HbAbstractItemView);
@@ -361,7 +410,7 @@
/*!
Selects all items in the view.
- */
+*/
void HbAbstractItemView::selectAll()
{
Q_D(HbAbstractItemView);
@@ -378,7 +427,7 @@
/*!
Deselects all selected items. The current index will not be changed.
- */
+*/
void HbAbstractItemView::clearSelection()
{
Q_D(HbAbstractItemView);
@@ -391,7 +440,7 @@
/*!
Returns current selection mode used by view.
- */
+*/
HbAbstractItemView::SelectionMode HbAbstractItemView::selectionMode() const
{
Q_D(const HbAbstractItemView);
@@ -400,7 +449,7 @@
/*!
Returns index of current item.
- */
+*/
QModelIndex HbAbstractItemView::currentIndex() const
{
Q_D(const HbAbstractItemView);
@@ -411,7 +460,7 @@
Sets current index to \a index. The item is selected depending on the \a selectionFlag.
By default item is not selected. If current selection mode is NoSelection,
item is not selected irrespective of the selection flag.
- */
+*/
void HbAbstractItemView::setCurrentIndex(const QModelIndex &index,
QItemSelectionModel::SelectionFlags selectionFlag)
{
@@ -433,7 +482,7 @@
Returns model index of the model's root item.
The root item is parent item to view's top level items.
The root can be invalid.
- */
+*/
QModelIndex HbAbstractItemView::rootIndex() const
{
Q_D(const HbAbstractItemView);
@@ -445,7 +494,7 @@
All view items are deleted and recreated
Note! View items may be created asynchronously.
- */
+*/
void HbAbstractItemView::setRootIndex(const QModelIndex &index)
{
Q_D(HbAbstractItemView);
@@ -459,7 +508,7 @@
/*!
Resets Item view.
- */
+*/
void HbAbstractItemView::reset()
{
Q_D(HbAbstractItemView);
@@ -472,7 +521,7 @@
/*!
\reimp
- It should be allways called by child class if overriden.
+ It should be always called by child class if overridden.
*/
bool HbAbstractItemView::event(QEvent *e)
{
@@ -550,7 +599,7 @@
/*!
Sets item recycling to \a enabled.
By default recycling is off.
- */
+*/
void HbAbstractItemView::setItemRecycling(bool enabled)
{
Q_D(HbAbstractItemView);
@@ -559,7 +608,7 @@
/*!
Returns whether item recycling feature is in use.
- */
+*/
bool HbAbstractItemView::itemRecycling() const
{
Q_D(const HbAbstractItemView);
@@ -589,7 +638,7 @@
/*!
Returns true if item with model index is fully or partially visible in view.
- */
+*/
bool HbAbstractItemView::isVisible(const QModelIndex & index) const
{
Q_D( const HbAbstractItemView );
@@ -600,7 +649,7 @@
Base class implemmentation. Take care about scrollTo when it was
called before view was visible (first scrollTo can be done after
first layoutRequest).
- It should be always called by child class if overriden.
+ It should be always called by child class if overridden.
Note! If item recycling is enabled, view item may not have reached its final
position, when this function returns. Then its position is fine tuned asynchronously.
@@ -628,16 +677,17 @@
/*!
Returns list of currently visible view items.
- */
+*/
QList<HbAbstractViewItem *> HbAbstractItemView::visibleItems() const
{
Q_D(const HbAbstractItemView);
QList<HbAbstractViewItem *> visibleItems;
- const int count(d->mContainer->items().count());
+ QList<HbAbstractViewItem *> containerItems = d->mContainer->items();
+ const int count(containerItems.count());
for (int i = 0; i < count; ++i) {
- if(d->visible(d->mContainer->items().at(i), false))
- visibleItems.append(d->mContainer->items().at(i));
+ if(d->visible(containerItems.at(i), false))
+ visibleItems.append(containerItems.at(i));
}
return visibleItems;
}
@@ -981,10 +1031,10 @@
}
/*!
- Returns the current name of layout definition of view items of this view
+ Returns the current name of layout definition of view items of this view.
\sa setLayoutName()
- */
+*/
QString HbAbstractItemView::layoutName() const
{
Q_D(const HbAbstractItemView);
@@ -1003,7 +1053,7 @@
is "default".
\sa layoutOption()
- */
+*/
void HbAbstractItemView::setLayoutName(const QString &layoutName)
{
Q_D(HbAbstractItemView);
@@ -1034,10 +1084,10 @@
}
/*!
- Returns the current value of the uniformItemsSizes property
+ Returns the current value of the uniformItemsSizes property.
By default, this property is false.
- */
+*/
bool HbAbstractItemView::uniformItemSizes() const
{
Q_D(const HbAbstractItemView);
@@ -1054,17 +1104,17 @@
}
/*!
- Sets the bitmask controlling the item animations.
- */
- void HbAbstractItemView::setEnabledAnimations(HbAbstractItemView::ItemAnimations flags)
+ Sets the bitmask controlling the item animations.
+*/
+void HbAbstractItemView::setEnabledAnimations(HbAbstractItemView::ItemAnimations flags)
{
Q_D(HbAbstractItemView);
d->mEnabledAnimations = flags;
}
/*!
- Returns the mask controlling the item animations.
- */
+ Returns the mask controlling the item animations.
+*/
HbAbstractItemView::ItemAnimations HbAbstractItemView::enabledAnimations() const
{
Q_D(const HbAbstractItemView);
@@ -1118,7 +1168,7 @@
}
/*!
- This slot is called when touch release event occurs for view item.
+ This slot is called when release event occurs for view item.
Default implementation calls emitReleased().
\sa HbAbstractViewItem::released(const QPointF &position)
@@ -1179,7 +1229,7 @@
/*!
This slot is called when concrete view item has been created. Default implementation connects
- touch event releated signals of HbAbstractViewItem to respective slots in this class.
+ touch event related signals of HbAbstractViewItem to respective slots in this class.
\sa HbAbstractViewItem::pressed(const QPointF &position)
\sa HbAbstractViewItem::released(const QPointF &position)
@@ -1214,13 +1264,13 @@
}
/*!
- * Sets the value of the longPressEnabled property. This value is set
- * to true if the widget is to respond to long press gestures, false otherwise.
- *
- * The default value is true.
- *
- * \sa HbAbstractItemView::longPressEnabled()
- */
+ Sets the value of the longPressEnabled property. This value is set
+ to true if the widget is to respond to long press gestures, false otherwise.
+
+ The default value is true.
+
+ \sa HbAbstractItemView::longPressEnabled()
+*/
void HbAbstractItemView::setLongPressEnabled(bool enabled)
{
Q_D(HbAbstractItemView);
@@ -1228,10 +1278,10 @@
}
/*!
- Returns true if the item view handles long press gestures, false otherwise
-
+ Returns true if the item view handles long press gestures, false otherwise.
+
\sa HbAbstractItemView::setLongPressEnabled()
- */
+*/
bool HbAbstractItemView::longPressEnabled() const
{
Q_D(const HbAbstractItemView);