qt5base-lts/src
Mark Brand 83c9ebbd66 QSqlQueryModel::setQuery() don't use deprecated reset()
Previously the method attempted to reset only as a last resort.

Now reset() is deprecated and resetting must happen between emitting
modelAboutToBeReset() and modelReset(). Since this suffices in all
cases to notify views that they must reinterrogate the model, it is no
longer necessary to signal explicitly row removals and insertions
within the scope of the reset.

Additionally, fetchMore() is now called within the scope of the reset
so insert signals do not have to be emitted here either.

This improved handling of resetting in QSqlQueryModel also allows the
cache in QSqlTableModel to be cleared directly at select().

This change may actually allow views to operate more efficiently since
they no longer have to react to separate row removal and insert
signals. Views can avoid pointless deallocation and reallocation
by considering row count only after the reset is finished. The cost is
that the columns and horizontal headers must be considered in the view
at each setQuery() call. In any case, it is not clear that trying to
be smart about this in the model justifies additional complexity.

Tests had to be adjusted where they expected explicit row removal
and insert signals.

Change-Id: I4f7eac1419824361d7d9bdcc6a87092b33e80d7a
Task-Id: QTBUG-25419
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-04-23 19:20:19 +02:00
..
3rdparty Fixed libjpeg compiler warning about macro redefinition. 2012-04-18 01:33:57 +02:00
concurrent Remove references to QT_NO_STL from QtConcurrent 2012-04-07 05:19:50 +02:00
corelib Fix warning in qobject.cpp 2012-04-23 15:38:09 +02:00
dbus qdbusxml2cpp: fix build on Windows 2012-04-19 01:57:58 +02:00
gui Fix compilation of QDesktopServices without deprecated 2012-04-23 15:39:24 +02:00
modules Revert "List QtPrintSupport as a dependency of QtPlatformSupport." 2012-04-20 12:46:47 +02:00
network Fix bug in qsslsocket peek() 2012-04-23 09:45:24 +02:00
opengl Removed legacy pixmap and image cleanup hooks. 2012-04-19 16:57:08 +02:00
platformsupport Extend QUDeviceHelper to detect DRM graphics devices. 2012-04-19 08:48:18 +02:00
plugins Build the QNX plugin with -no-opengl enabled. 2012-04-23 17:04:04 +02:00
printsupport PrintSupport - Remove Qt5 To-do Messages 2012-04-19 22:15:16 +02:00
sql QSqlQueryModel::setQuery() don't use deprecated reset() 2012-04-23 19:20:19 +02:00
testlib Change coreservices -> ios 2012-04-19 01:57:58 +02:00
tools QDoc: Support -indexdir on CLI and depends in qdocconf. 2012-04-23 09:45:24 +02:00
widgets Fix unmatched double quote character 2012-04-23 09:45:24 +02:00
winmain replace uses of QMAKE_INCDIR_QT and QMAKE_LIBDIR_QT with module-specific variables 2012-03-08 18:57:56 +01:00
xml Doc: Fix most QDoc errors in QtXml. 2012-04-23 09:45:24 +02:00
qbase.pri Moved common module profiles to be feature profiles. 2011-06-05 14:47:14 +02:00
qt_install.pri Moved common module profiles to be feature profiles. 2011-06-05 14:47:14 +02:00
qt_targets.pri Moved common module profiles to be feature profiles. 2011-06-05 14:47:14 +02:00
src.pro Reintroduce testlib to widget free builds 2012-04-17 03:26:32 +02:00