summaryrefslogtreecommitdiffstats
path: root/tests/auto/sql/models/qsqltablemodel
Commit message (Collapse)AuthorAgeFilesLines
* QSqlTableModel::orderByClause(): Quote the table nameFriedemann Kleint2021-05-031-24/+26
| | | | | | | | | | | This ensures correct handling of names with special characters. Pick-to: 5.15 6.1 Fixes: QTBUG-92584 Change-Id: I95c7c54d9c7ee00b221a55f3d07ef1ec3a3bd217 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* SQLite: Handle tables and fields with a dot in the name correctlyAndy Shaw2021-04-231-0/+49
| | | | | | | Fixes: QTBUG-91885 Pick-to: 6.1 6.0 5.15 Change-Id: Iba76bb50266dd4fb5f50e4ea1549d1d2bb6e3431 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-071-5/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-221-1/+2
| | | | | | | | | | | Complete search and replace of QtTest and QtTest/QtTest with QTest, as QtTest includes the whole module. Replace all such instances with correct header includes. See Jira task for more discussion. Fixes: QTBUG-88831 Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Cleanup remaining QVariant::Type uses in Qt SqlLars Knoll2020-10-171-9/+9
| | | | | Change-Id: Ibcaa678cd9f9c957392a75b477fa6821f9a69127 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-09-231-1/+1
| | | | | | | | | | | Modify special case locations to use the new API as well. Clean up some stale .prev files that are not needed anymore. Clean up some project files that are not used anymore. Task-number: QTBUG-86815 Change-Id: I9947da921f98686023c6bb053dfcc101851276b5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Interbase: Fix tests when running against FirebirdAndy Shaw2020-08-231-20/+33
| | | | | Change-Id: Ibfcf6b557aed3b0cd2e0ece5cf122819a1acc0c1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Deprecate QVariant::Type uses in QSqlFieldLars Knoll2020-08-151-3/+3
| | | | | | | | Add metaType()/setMetaType() methods to be used instead of the type() methods taking a QVariant::Type. Change-Id: Ieaba35b73f8061cd83288dd6b50d58322db3c7ed Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Fix warnings about unused variables and functions in testsTor Arne Vestbø2020-07-261-1/+0
| | | | | Change-Id: Ia758a91384083c13fb4d743f500fef7a6629dfd5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Regenerate tests with new qt_ prefixed APIsAlexandru Croitor2020-07-091-1/+1
| | | | | | | | Use pro2cmake with '--api-version 2' to force regenerate projects to use the new prefixed qt_foo APIs. Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-07-071-1/+1
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Sql: Fix heap-user-after-free for globally initialized db objectsAlexandru Croitor2020-07-011-3/+12
| | | | | | | | | | | | | | | Becaues the database objects were created as globals, there was a possible use-after-free issue when deleting the objects on application exit. Move the initialization of the database objects into static variables inside the test constructor. As a drive-by, also add one missing test to the CMake projects. Fixes: QTBUG-85357 Change-Id: I2c8f2c5daee96bb9d1d21dae37950a2da5ffdf27 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Regenerate projects one last time before mergewip/cmakeAlexandru Croitor2020-02-121-3/+2
| | | | | | Change-Id: Ia24cf56b79ca6dacd370a7e397024e9b663e0167 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Regenerate tests/auto/sqlAlexandru Croitor2019-11-131-1/+10
| | | | | Change-Id: If411b1e7c3a7cb58922e5a48309f42ba29f2c068 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-07-111-3/+4
|\ | | | | | | Change-Id: I715b1d743d5f11560e7b3fbeb8fd64a5e5ddb277
| * Convert uses of QTime as a timer to QElapsedTimerEdward Welbourne2019-06-141-3/+4
| | | | | | | | | | | | | | | | Change-Id: I2297f61efa5adf9ea5194c7f3ff68574cbcf452c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge commit 'dev' into 'wip/cmake-merge'Tobias Hunger2019-04-161-10/+0
|\| | | | | | | Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
| * Always escape the table names when creating the SQL statementAndy Shaw2019-01-231-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since some databases are case sensitive if part of the query is quoted, then we should ensure that all instances of the table name are escaped unless the test is delibrately testing the non-escaped case. As a result, this commit also removes some expected failures pertaining to PostgreSQL and also adds an entry to the list of tables being dropped when a test is finished. [ChangeLog][Sql][PostgreSQL] QSqlDatabase is now stricter about table names when used with record() and primaryIndex(). If the tablename was not quoted when it was created, then the table name passed to record() and primaryIndex() needs to be in lower case so that PostgreSQL is able to find it. Fixes: QTBUG-65788 Change-Id: Id1f54cb66b761c39edf858501b730ede7eec1fd3 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Add Sql build and testsTobias Hunger2018-11-051-0/+6
|/ | | | | | Change-Id: I9bf7d61a65950eafcfe6b3ea9c437e353ff7b2ed Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Initialize the QSqlQuery to be invalid when creating a sql modelAndy Shaw2018-08-281-0/+47
| | | | | | | | | | | | | | | When QSqlQueryModel or QSqlTableModel is created it will create a QSqlQuery which defaults to using the default QSqlDatabase connection. If this connection belongs to another thread then it will throw a warning as this is not safe to use. Since the QSqlQuery is always recreated when a query is set, the instance which is a member of the class can effectively be invalid until a new one is set. Task-number: QTBUG-69213 Change-Id: I68a5dd59fe62788f531d59a0680da11b118ee383 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* psql: Add expected failures where the table name is case sensitiveAndy Shaw2018-02-211-0/+11
| | | | | | | | | | Currently there is a bug in Qt regarding the PostgreSQL driver as it does not correctly escape the table names when constructing queries internally. Therefore, these tests are marked as expected failures until the bug itself is fixed in Qt. Change-Id: I74dadc187f8a08509128dfea27be99787e57ea51 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* psql: Fix SQL testsAndy Shaw2018-02-201-1/+1
| | | | | | | | | | | | This also accounts for some quirks on the PostgreSQL side: - Null values for a related table are placed in a different order when sorted. - Functions (sum, count) return a different type than other databases - Using quotes to account for case sensitivity with tables Task-number: QTBUG-63861 Change-Id: Ib1894fa8d0c77d7045941f7c57be0d0acd8d117e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QSql tests: Remove Windows CE and clean up code.Friedemann Kleint2016-03-101-10/+0
| | | | | | | | | | | Use the newly introduced QSysInfo::machineHostName() to determine the host name in the shared header, removing the need to link against the winsocket library. All Windows-specific .pro sections can then be removed. Task-number: QTBUG-51673 Change-Id: Iba990b886b16addd210639871065abde6de96516 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-211-17/+12
| | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Tests: Fix single-character string literals.Friedemann Kleint2015-10-131-1/+1
| | | | | | | Use character literals where applicable. Change-Id: I1a026c320079ee5ca6f70be835d5a541deee2dd1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Tests: Remove CONFIG += parallel_test.Friedemann Kleint2015-09-051-1/+0
| | | | | | | The keyword no longer has a meaning for the new CI. Change-Id: Ibcea4c7a82fb7f982cf4569fdff19f82066543d1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* tests/auto/sql: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).Friedemann Kleint2015-07-291-9/+9
| | | | | | | | | | | | - Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer). - Replace Q[TRY]_VERIFY(smartPointer == 0) by Q[TRY]_VERIFY(smartPointer.isNull()). - Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and add casts where necessary. The values will then be logged should a test fail. Change-Id: I4e4a319c5918d697a33f6d6032c36b8c9660ca05 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* fix usage of wince scopeOswald Buddenhagen2015-06-051-1/+1
| | | | | | | Fix style issues along the way. Change-Id: Ic6a6de28e198eb0b14c198b802e78845703909b9 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Adjust DBMSType to DbmsType to follow conventionsAlejandro Exojo2014-11-261-3/+3
| | | | | | | | | The enum was made public in f84b00c6d26eb7a3a6802210d2a8b12ddbf815aa, but this makes it follow the convention to camel case acronyms too before it's too late to change it. Change-Id: Ibb81e9221cb73fe0502d0a26f2d73512dd142f08 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Expose QSqlDriverPrivate dbmsType in public QSqlDriver apiMatt Broadstone2014-09-241-6/+6
| | | | | | | | | | dbmsType was previously kept as a private variable in QSqlDriverPrivate, however it's particularly useful for QODBC users. [ChangeLog][QtSql][QSqlDriver] Add support for determining DBMS type from SQL driver. Change-Id: If1c221520da9ac4ccef85a02db078679d76eac92 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Improve handling of temporary directories in SQL tests.Friedemann Kleint2014-04-041-2/+3
| | | | | | | | | | | | | | Initialize directory delayed in shared code and add checks to verify that it is valid. Close attached / cloned databases to prevent locks on files and leaking temporary directories caused by SQLite: QTemporaryDir: Unable to remove "...\Temp\tst_qsqldatabase-P1XkOA" most likely due to the presence of read-only files. QTemporaryDir: Unable to remove "...\Temp\tst_qsqltablemodel-P1XkOA" most likely due to the presence of read-only files. QWARN : tst_QSql::concurrentAccess() QTemporaryDir: Unable to remove "...\Temp\tst_qsql-l0VAKJ" most likely due to the presence of read-only files. Change-Id: If85bbaed04bb1a32e427d642be332996d967f796 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Enable running sql model tests in parallelFrederik Gladhorn2014-01-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each model test gets its own temporary directory, thus there is no problem parallelizing them. This should reduce the time spent for a testrun of qtbase by around 3 minutes. When running only the sql tests it saves less since there are no other tests to run in parallel. === Timing: =================== TEST RUN COMPLETED! ============================ Total: 4 minutes 43 seconds Serial tests: 4 minutes 42 seconds Parallel tests: 1 second Estimated time spent on insignificant tests: (no time) Estimated time saved by -j4: 1 second === Totals: 12 tests, 12 passes ================================================ After: === Timing: =================== TEST RUN COMPLETED! ============================ Total: 4 minutes 7 seconds Serial tests: 50 seconds Parallel tests: 3 minutes 17 seconds Estimated time spent on insignificant tests: (no time) Estimated time saved by -j4: 1 minute 23 seconds === Totals: 12 tests, 12 passes ================================================ Change-Id: I355ceed62fae852ad8cd442848e263438afb738e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Cleanup the SQL testsAndy Shaw2013-04-251-3/+6
| | | | | | | | | | This removes some XFAILS that were no longer correct and fixes some existing problems in the tests where ODBC is concerned. Change-Id: I91de526bb50ad4046ba07ddb5336aa3714966687 Reviewed-by: Mark Brand <mabrand@mabrand.nl> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Fix sql tests in respect to Oracle databasesAndy Shaw2013-04-051-31/+31
| | | | | | | | | | Oracle has a limitation of 30 characters for a tablename so the main change is to account for this, which meant changing all the usages of qTableName(). Some other fixes are included that ensure the tests are working correctly as far as Oracle is concerned. Change-Id: I8ad8a5a33e6a70fcad235f6a7e82e91687b74fee Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QtSql tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0Debao Zhang2013-03-281-1/+0
| | | | | Change-Id: I93169244b51f8b993f97f7595e0bc7006ae04e3a Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* fix QSqlTableModel:revert() for OnFieldChangeMark Brand2013-02-091-0/+79
| | | | | | | | | | | | revert() should operate in OnFieldChange edit strategy just as submit() does. The reason in Qt 4 for excluding OnFieldChange was that there was no opportunity to revert. The model was refreshed, causing all changes to be lost. In Qt 5 a failed edit remains in the cache until user action, which could be to revert. Change-Id: Ide021c4f83a53834b7ed81f2abfa3aa49317704d Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QSqlTableModel: support refreshing inserted rows with auto columnsMark Brand2013-02-061-0/+68
| | | | | | | | | | | | | | | | | | Previously, selectRow() did not work after INSERTing a new row into a table with an automatically populated column. It did not work because the model did not know the primary values for the new row. Newly inserted rows were therefore not refreshed in OnFieldChange and OnRowChange edit strategies. This change provides support for the typical simple case where a single column is populated by the database and can be retrieved with QSqlQuery::lastInsertId(). Task-Number: QTBUG-29102 Change-Id: Ibf0f0ac8661185bde57034ddf40c2178bece4778 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Lukas Geyer <lgeyer@gmx.at> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QSqlTableModel::setData(): fix non-change detectionMark Brand2013-02-061-0/+73
| | | | | | | | | | | | | | | Commit 10ff9de91bedf93852f13a58287afd8831644759 introduced the optimization of ignoring non-changes, but it overshot the mark. It neglected to consider that QVariant's equality operator does not compare the null flag. It also failed to consider that setData() has a useful side effect of setting the generated flag in a column of a pending INSERT. This is important when the application actually wants a NULL to be inserted into the column. Task-number: QTBUG-29217 Change-Id: I1368f7acc21eebfeb5a8d23746fc38f6f30fd395 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* fix QSqlTableModel::headerData() for empty query with inserted rowMark Brand2013-02-061-0/+8
| | | | | | | | | | | | | | QSqlQueryModel::headerData() relied on virtual indexInQuery() to detect whether the requested column at row 0 mapped to an index in the query. This failed when row 0 was a pending insert managed by QSqlTableModel, and therefore not in the query. The only thing that matters here is the column. Task-number: QTBUG-29108 Change-Id: I3e0ae85ba223e444781ec8033386d394bb44f0e8 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Tests: Remove declaration of built-in and automatic metatypes.Stephen Kelly2013-01-061-1/+0
| | | | | | | | These types are either built-in or 'automatically declared' and so don't need to be explicitly declared as metatypes. Change-Id: Ifd116dee32a450ff89a9a1011e26b434765d6e95 Reviewed-by: David Faure <david.faure@kdab.com>
* Remove metatype registration of built-in types.Stephen Kelly2013-01-031-1/+0
| | | | | | | | As they are built-in, they are effectively registered at compile-time already. Change-Id: I7ae6ba16088eab5d19213fa7b07c2a7760988a86 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Remove warnings from qtbase.Mitch Curtis2012-11-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | geometryengine.cpp: In member function 'void GeometryEngine::drawCubeGeometry(QGLShaderProgram*)': geometryengine.cpp:159:93: warning: cast to pointer from integer of different sie [-Wint-to-pointer-cast] geometryengine.cpp:167:95: warning: cast to pointer f rom integer ofdifferent size [-Wint-to-pointer-cast] benchmarking.cpp: In member function 'void TestBenchmark::multiple()': benchmarking.cpp:85:9: warning: variable 'result' set but not used [-Wunused-but-set-variable] benchmarking.cpp: In member function 'void TestBenchmark::series()': benchmarking.cpp:120:9: warning: variable 'result' set but not used [-Wunused-but-set-variable] qstandarditemmodel.cpp:2717:45: warning: unused variable 'd' [-Wunused-variable] qxcbconnection.cpp: In member function 'xcb_timestamp_t QXcbConnection::getTimestamp()': qxcbconnection.cpp:930:40: warning: suggest parentheses around assignment used as truth value [-Wparentheses] tst_qguiapplication.cpp: In constructor 'BlockableWindow::BlockableWindow()': tst_qguiapplication.cpp:340:9: warning:'BlockableWindow::enters' will be initialized after [-Wreorder] tst_qguia pplication.cpp:339:9: warning 'int BlockableWindow::leaves' [-Wreorder] tst_qguiapplication.cpp:342:12: waring: when initialized here [-Wreorder] tst_qsqltablemodel.cpp:570:10: warning: unused parameter 'value' [-Wunused-parameter] tst_qabstractitemview.cpp:1546:8: warning: unused parameter 'index' [-Wunused-parameter] Change-Id: I49c88547182e4669cfde2c2536403fc5573ca2da Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* normalise signal/slot signatures [QtSql tests]Marc Mutz2012-10-191-3/+3
| | | | | Change-Id: I06573bc2ad58378dd835565cd07d711bfc760411 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QSqlTableModel::selectRow(): don't expand cache if there is no changeMark Brand2012-10-052-2/+21
| | | | | | | | Test added. Change-Id: Ibd72ef2aeee482abbd22991573460e55dc577457 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: David Faure (fixes for KDE) <faure@kde.org>
* QSqlTableModel: record(row) must use virtual data()Mark Brand2012-10-051-0/+41
| | | | | | | | | | | | | | Commit fbf010a26617b3986e9a76bd9c004403aebfcdc2 introduced a version of record(row) that includes the generated flags, but it neglected to populate the values using virtual data() as QSqlQueryModel correctly does. Test included lest we forget again. Change-Id: I49d0f8f87cd0c5078aa6a0e8373b2cffc01f2387 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QSqlTableModel: restore use of virtual setData() in setRecord()Mark Brand2012-10-051-9/+48
| | | | | | | | | | | | | | | | setRecord() should use setData() as intended so that reimplementations of setData() in subclasses will be respected. Commit 11bd543d901f67f79db3f5b5dfaa626c6e8faa45 failed to consider this. Test added which should prevent this mistake being repeated. Change-Id: Ia2d930cd42b5a27521bb389edb1b07fb1bf0fa36 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QSqlTableModel: don't cache unchanged value in setData()Mark Brand2012-10-051-0/+8
| | | | | | | | | | | | | | | | | | | | | | This is good for performance in terms of avoiding unnecessary database activity and keeping the cache smaller. Detail: This change was not included in the big refactoring of QSqlTM. The idea was that the model shouldn't second guess the intention of the application and maybe the application wants to cause a submit. It was a marginal consideration. Now I think it's clear that our interest in not unnecessarily expanding the cache outweighs that. In addition, applications can now call selectRow() if they worry that the database values for the row have changed and want to set a value back again. Test added. Change-Id: I63814dcb63a96c6ba1c8cc227807725a954a0b68 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: David Faure <david.faure@kdab.com>