summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-10-29 14:44:08 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-10-29 14:44:08 (GMT)
commit02d815b4bd497a5c7f07330576a5e3c3da3f46ab (patch)
tree952187386613641bb1a51df67d2077dfc97bac9b /src/gui
parent95ddf23a0c9e0120d55d7104480d78a64fa8cc77 (diff)
downloadQt-02d815b4bd497a5c7f07330576a5e3c3da3f46ab.zip
Qt-02d815b4bd497a5c7f07330576a5e3c3da3f46ab.tar.gz
Qt-02d815b4bd497a5c7f07330576a5e3c3da3f46ab.tar.bz2
QListView: make sure we relayout items when data changes in the model
Task-number: QTBUG-633 Reviewed-by: ogoffart
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/itemviews/qlistview.cpp6
-rw-r--r--src/gui/itemviews/qlistview_p.h3
2 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp
index 109d760..d680af8 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -2403,6 +2403,12 @@ QVector<QModelIndex> QListModeViewBase::intersectingSet(const QRect &area) const
return ret;
}
+void QListModeViewBase::dataChanged(const QModelIndex &, const QModelIndex &)
+{
+ dd->doDelayedItemsLayout();
+}
+
+
QRect QListModeViewBase::mapToViewport(const QRect &rect) const
{
if (isWrapping())
diff --git a/src/gui/itemviews/qlistview_p.h b/src/gui/itemviews/qlistview_p.h
index 3f8f9db..31459b0 100644
--- a/src/gui/itemviews/qlistview_p.h
+++ b/src/gui/itemviews/qlistview_p.h
@@ -130,6 +130,7 @@ public:
virtual void clear() = 0;
virtual void setRowCount(int) = 0;
virtual QVector<QModelIndex> intersectingSet(const QRect &area) const = 0;
+ virtual void dataChanged(const QModelIndex &, const QModelIndex &) = 0;
virtual int horizontalScrollToValue(int index, QListView::ScrollHint hint,
bool leftOf, bool rightOf, const QRect &area, const QRect &rect) const;
@@ -141,7 +142,6 @@ public:
virtual int verticalOffset() const { return verticalScrollBar()->value(); }
virtual void updateHorizontalScrollBar(const QSize &step);
virtual void updateVerticalScrollBar(const QSize &step);
- virtual void dataChanged(const QModelIndex &, const QModelIndex &) { }
virtual void appendHiddenRow(int row);
virtual void removeHiddenRow(int row);
virtual void setPositionForIndex(const QPoint &, const QModelIndex &) { }
@@ -217,6 +217,7 @@ public:
void clear();
void setRowCount(int rowCount) { flowPositions.resize(rowCount); }
QVector<QModelIndex> intersectingSet(const QRect &area) const;
+ void dataChanged(const QModelIndex &, const QModelIndex &);
int horizontalScrollToValue(int index, QListView::ScrollHint hint,
bool leftOf, bool rightOf,const QRect &area, const QRect &rect) const;