aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2011-08-02 10:53:52 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-02 06:42:28 +0200
commit9dfd621aec9a031297c50dd7df5ca90c771f46a3 (patch)
tree6ec911d518f64b73f80408264e47d426549ced6d
parentab40ff7046db2a922ae6959b44f1a52416566b7a (diff)
Call base class init() from QSGListViewPrivate
Regression from 9b5f9c8056186c9cf3c40dbac66e5f90369339dc when QSGItemView was created. Also fixed other reimplemented methods in QSGListViewPrivate to call their base class functions (which are currently empty) and changed some virtual methods in QSGItemViewPrivate to non-virtual where they didn't need to be virtual. Task-number: QTBUG-20679 Change-Id: I489593b3eab4f5bbb4126906f170342d1e8811cd Reviewed-on: http://codereview.qt.nokia.com/2462 Reviewed-by: Bea Lam <bea.lam@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
-rw-r--r--src/declarative/items/qsgitemview_p_p.h11
-rw-r--r--src/declarative/items/qsglistview.cpp7
2 files changed, 13 insertions, 5 deletions
diff --git a/src/declarative/items/qsgitemview_p_p.h b/src/declarative/items/qsgitemview_p_p.h
index 3113a8b754..96aec8f2c0 100644
--- a/src/declarative/items/qsgitemview_p_p.h
+++ b/src/declarative/items/qsgitemview_p_p.h
@@ -95,10 +95,10 @@ public:
void adjustMoveParameters(int *from, int *to, int *count) const;
virtual void init();
- virtual void updateCurrent(int modelIndex);
virtual void clear();
- virtual void regenerate();
virtual void updateViewport();
+
+ void regenerate();
void layout();
void refill();
void refill(qreal from, qreal to, bool doBuffer = false);
@@ -111,6 +111,7 @@ public:
QSGItem *createHighlightItem();
QSGItem *createComponentItem(QDeclarativeComponent *component, bool receiveItemGeometryChanges, bool createDefault = false);
+ void updateCurrent(int modelIndex);
void updateTrackedItem();
void updateUnrequestedIndexes();
void updateUnrequestedPositions();
@@ -191,14 +192,14 @@ protected:
virtual void visibleItemsChanged() = 0;
virtual FxViewItem *newViewItem(int index, QSGItem *item) = 0;
- virtual void initializeViewItem(FxViewItem *) {}
virtual void repositionPackageItemAt(QSGItem *item, int index) = 0;
virtual void layoutVisibleItems() = 0;
-
- virtual void updateSections() {}
virtual void changedVisibleIndex(int newIndex) = 0;
+
+ virtual void initializeViewItem(FxViewItem *) {}
virtual void initializeCurrentItem() {}
+ virtual void updateSections() {}
virtual void itemGeometryChanged(QSGItem *item, const QRectF &newGeometry, const QRectF &oldGeometry);
};
diff --git a/src/declarative/items/qsglistview.cpp b/src/declarative/items/qsglistview.cpp
index 9c3ab2a285..15042bea91 100644
--- a/src/declarative/items/qsglistview.cpp
+++ b/src/declarative/items/qsglistview.cpp
@@ -455,6 +455,7 @@ void QSGListViewPrivate::changedVisibleIndex(int newIndex)
void QSGListViewPrivate::init()
{
+ QSGItemViewPrivate::init();
::memset(sectionCache, 0, sizeof(QSGItem*) * sectionCacheSize);
}
@@ -498,6 +499,8 @@ FxViewItem *QSGListViewPrivate::newViewItem(int modelIndex, QSGItem *item)
void QSGListViewPrivate::initializeViewItem(FxViewItem *item)
{
+ QSGItemViewPrivate::initializeViewItem(item);
+
QSGItemPrivate *itemPrivate = QSGItemPrivate::get(item->item);
itemPrivate->addItemChangeListener(this, QSGItemPrivate::Geometry);
@@ -815,6 +818,8 @@ void QSGListViewPrivate::createSection(FxListItemSG *listItem)
void QSGListViewPrivate::updateSections()
{
+ QSGItemViewPrivate::updateSections();
+
if (sectionCriteria && !visibleItems.isEmpty()) {
QString prevSection;
if (visibleIndex > 0)
@@ -871,6 +876,8 @@ void QSGListViewPrivate::updateCurrentSection()
void QSGListViewPrivate::initializeCurrentItem()
{
+ QSGItemViewPrivate::initializeCurrentItem();
+
if (currentItem) {
FxListItemSG *listItem = static_cast<FxListItemSG *>(currentItem);