diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-06-29 14:29:06 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-07-27 09:23:46 +0000 |
commit | d70ec0045af17458fe29a8ced6aec14820ac8148 (patch) | |
tree | 0cc41277fa5d0811ad63c93a37f0f29f03ddfc9f /src/location/places | |
parent | 850c0bbba4c4c65df90f26e1e6174ce68b61d73c (diff) | |
download | qtlocation-d70ec0045af17458fe29a8ced6aec14820ac8148.tar.gz |
Enable asynchronous incremental updates of QPlaceReply
This patch adds a new signal to QPlaceReply, contentUpdated.
This signal can be emitted in subclasses when the provider is capable
of notifying partial updates of the content.
The typical use case if fetching the data from multiple databases, also
locally instead of over network, and incrementally populating the
results, as opposed to the current way of operating, that is via previous
page / next page, in which case it's the backend who provides the proper
query parameters to obtain the previous or the next page.
This signal is currently handled only for QPlaceSearchReplies in
QDeclarativeSearchResultModel, where such a signal would trigger a
layout update.
Change-Id: I0aaba5aa9249b61c970d3a309d93fab7fc39d667
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/places')
-rw-r--r-- | src/location/places/qplacereply.cpp | 13 | ||||
-rw-r--r-- | src/location/places/qplacereply.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/location/places/qplacereply.cpp b/src/location/places/qplacereply.cpp index 55e67e43..29f1fb84 100644 --- a/src/location/places/qplacereply.cpp +++ b/src/location/places/qplacereply.cpp @@ -229,6 +229,19 @@ void QPlaceReply::abort() */ /*! + \fn void QPlaceReply::contentUpdated() + + This signal is emitted when this reply has updated content available. + Depending on the plugin, this signal may never be emitted or emitted + multiple times before \l QPlaceReply::finished() is emitted, as some + backends are able to return the requested content asynchronously and + incrementally. + + \note Do not delete or deleteLater this reply object in the slot + connected to this signal. Do it only upon \l QPlaceReply::finished. +*/ + +/*! \fn void QPlaceReply::error(QPlaceReply::Error error, const QString &errorString) This signal is emitted when an error has been detected in the processing of diff --git a/src/location/places/qplacereply.h b/src/location/places/qplacereply.h index 8fd34643..8e84f113 100644 --- a/src/location/places/qplacereply.h +++ b/src/location/places/qplacereply.h @@ -86,6 +86,7 @@ public Q_SLOTS: Q_SIGNALS: void finished(); + void contentUpdated(); void aborted(); void error(QPlaceReply::Error error, const QString &errorString = QString()); |