src/hbwidgets/itemviews/hbabstractitemcontainer_p.cpp
changeset 34 ed14f46c0e55
parent 7 923ff622b8b9
--- a/src/hbwidgets/itemviews/hbabstractitemcontainer_p.cpp	Mon Oct 04 17:49:30 2010 +0300
+++ b/src/hbwidgets/itemviews/hbabstractitemcontainer_p.cpp	Mon Oct 18 18:23:13 2010 +0300
@@ -84,6 +84,8 @@
 {
     Q_Q(HbAbstractItemContainer);
     q->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
+
+    q->setFlag(QGraphicsItem::ItemHasNoContents, true);
 }
 
 /*!
@@ -138,6 +140,8 @@
 {
     if (item) {
         QRectF itemRect(itemBoundingRect(item));
+        // 0.5 tolerance otherwise it fail - for instance if pos.y = -5.68434e-14 then item will be not fullyVisible
+        itemRect.adjust(0.5, 0.5, -0.5, -0.5);
         if (fullyVisible) {
             if (viewRect.contains(itemRect)) {
                 return true;
@@ -416,6 +420,8 @@
     mItems.removeOne(item);
     q->itemRemoved(item, animate);
 
+    emit q->itemAboutToBeDeleted(item);
+
 #ifndef HB_EFFECTS
     delete item;
 #else
@@ -530,7 +536,7 @@
 {
     Q_D(HbAbstractItemContainer);
 
-	d->q_ptr = this;
+    d->q_ptr = this;
     d->init();
 }
 
@@ -601,6 +607,9 @@
     d->mItems.clear();
     d->mItemStateList.clear();
     d->mItemStates.clear();
+
+    emit itemAboutToBeDeleted(0);
+
 }
 
 /*!
@@ -717,8 +726,8 @@
     }
 
     // if items have been added/removed in the middle of the buffer, there might be items 
-	// that can be reused at the end of the buffer. The following block will scan for 
-	// those items and move them in correct position 
+    // that can be reused at the end of the buffer. The following block will scan for 
+    // those items and move them in correct position 
     int lastUsedItem = -1;
     for (int indexCounter = 0; indexCounter < indexList.count(); ++indexCounter) {
         HbAbstractViewItem *item = d->mItems.at(indexCounter);