summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qabstractitemview.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-07-07 14:42:20 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-07-07 14:46:27 (GMT)
commit424e2e68f9a3f556ad2d06e2fbceac0d48c060be (patch)
tree6ab9619e0da615431c748017ea42d4dc61b28869 /src/gui/itemviews/qabstractitemview.cpp
parent5f48e2a16b0b64536a205320fbf7a22f7461d80d (diff)
downloadQt-424e2e68f9a3f556ad2d06e2fbceac0d48c060be.zip
Qt-424e2e68f9a3f556ad2d06e2fbceac0d48c060be.tar.gz
Qt-424e2e68f9a3f556ad2d06e2fbceac0d48c060be.tar.bz2
ItemViews: _q_fetchMore now uses a timer instead of invokeMethod
Diffstat (limited to 'src/gui/itemviews/qabstractitemview.cpp')
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index cefe8a5..dd84304 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -2200,6 +2200,8 @@ void QAbstractItemView::resizeEvent(QResizeEvent *event)
void QAbstractItemView::timerEvent(QTimerEvent *event)
{
Q_D(QAbstractItemView);
+ if (event->timerId() == d->fetchMoreTimer.timerId())
+ d->fetchMore();
if (event->timerId() == d->autoScrollTimer.timerId())
doAutoScroll();
else if (event->timerId() == d->updateTimer.timerId())
@@ -2415,7 +2417,7 @@ void QAbstractItemView::updateEditorGeometries()
void QAbstractItemView::updateGeometries()
{
updateEditorGeometries();
- QMetaObject::invokeMethod(this, "_q_fetchMore", Qt::QueuedConnection);
+ d_func()->fetchMoreTimer.start(0, this); //fetch more later
}
/*!
@@ -2960,7 +2962,7 @@ void QAbstractItemView::dataChanged(const QModelIndex &topLeft, const QModelInde
void QAbstractItemView::rowsInserted(const QModelIndex &, int, int)
{
if (!isVisible())
- QMetaObject::invokeMethod(this, "_q_fetchMore", Qt::QueuedConnection);
+ d_func()->fetchMoreTimer.start(0, this); //fetch more later
else
updateEditorGeometries();
}
@@ -3183,7 +3185,7 @@ void QAbstractItemView::currentChanged(const QModelIndex &current, const QModelI
update(current);
edit(current, CurrentChanged, 0);
if (current.row() == (d->model->rowCount(d->root) - 1))
- d->_q_fetchMore();
+ d->fetchMore();
} else {
d->shouldScrollToCurrentOnShow = d->autoScroll;
}
@@ -3604,8 +3606,9 @@ QAbstractItemViewPrivate::contiguousSelectionCommand(const QModelIndex &index,
}
}
-void QAbstractItemViewPrivate::_q_fetchMore()
+void QAbstractItemViewPrivate::fetchMore()
{
+ fetchMoreTimer.stop();
if (!model->canFetchMore(root))
return;
int last = model->rowCount(root) - 1;