summaryrefslogtreecommitdiffstats
path: root/src/sql
Commit message (Collapse)AuthorAgeFilesLines
* Change QtSql documentation to recommend QString::toUtf8Thiago Macieira2012-05-031-3/+3
| | | | | Change-Id: I604166677ea182553adffc4835050f2964f2aef9 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Add "make docs" target for QtNetwork and sanitize other qdocconfs.Casper van Donderen2012-05-021-20/+20
| | | | | Change-Id: Ic9d6384b20162debeb69cb067c96c330c0fd999a Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Don't use obsolete qVariantValue, qVariantCanConvert, etc.Debao Zhang2012-05-021-1/+1
| | | | | | | | | | qVariantValue and qVariantCanConvert are Compatibility members, while in Qt4.8 they are marked as Qt 3 Support Members. qVariantFromValue and qVariantSetValue are Obsolete members. Change-Id: Ie8505cad1e0950e40c6f6710fde9f6fb2ac670fd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Doc: Fix most qdoc errors in QtSql.Casper van Donderen2012-04-2835-167/+3667
| | | | | | | | | - Move 2 images from qtdoc. - Add "make docs" command for qtsql - Fix qdoc command usage errors. Change-Id: Id2f0548d09ed8f77b2317863d443c19d1cccdd83 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix memory leaks in 64-bits ODBC driverHonglei Zhang2012-04-261-2/+4
| | | | | | | | | | | | | | On 64-bits Windows system, integers and longs are still 4 bytes values. Several functions that were previously defined with SQLINTEGER and SQLUINTEGER parameters have been changed where appropiate to use new SQLLEN and SQLULEN typedefs. SQLGetStmtAttr() is one of these functions. This fix replaces SQLINTEGER with SQLULEN in appropriate functions to avoid memory leaks. Task-number: QTBUG-25256 Change-Id: I744927f42b8578ece60815df360e3b337ebf452a Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QSqlQueryModel::setQuery() don't use deprecated reset()Mark Brand2012-04-234-50/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* QSqlQueryModel::fetchMore() documentation fixMark Brand2012-04-231-1/+1
| | | | | | Change-Id: If046e674abad9c2dcff934a2fdd80d4133e1f4ad Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* remove useless workaroundMark Brand2012-04-171-2/+1
| | | | | | | | | | | | | | The workaround attempts to let the application reserve memory in QString for receiving the stored procedure output parameter. This does not work because the reserved capacity is not preserved through QVariant. Unfortunately, the application must actually populate QString with at least the number of characters that will be received. Change-Id: Icb3be60d6bd570ad2349f20fb7d93b340e395627 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QTBUG-18435 fix stored procedure output parameters on ODBCMark Brand2012-04-171-5/+6
| | | | | | | | | | | | | | | | Follow-up to c55a99965d8c08d5f924d49db4fe4aa49df8096. 3 problems prevented stored procedure output parameters from working. - SQLBindParameter needs access to buffer provided by QByteArray. - The length of the buffer is measured in bytes. - A typo corrupted conversion back to QString. Also, data() makes more sense than constData() to expose the buffer. Task-Id: QTBUG-18435 Change-Id: I66444b13c0f584ed79bcf026e5a23caff83c22cb Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Merge remote-tracking branch 'origin/master' into api_changesLars Knoll2012-04-161-5/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/corelib/io/qurl.cpp src/gui/kernel/qwindow.cpp src/tools/moc/generator.cpp src/widgets/kernel/qwidget_qpa.cpp src/widgets/styles/qstyle.h src/widgets/widgets/qtabbar.cpp tests/auto/corelib/codecs/utf8/tst_utf8.cpp Change-Id: Ia457228d6f684ec8184e13e8fcc9d25857b1751e
| * QTBUG-1363: fix QSqlField.length() for ODBCMark Brand2012-04-131-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Applied Bill King's suggestion in QTBUG-1363. Columns of hStmt must be accessed in order. Verified using ODBC driver on SQL Server 2005 on Windows 7. Added test for length of text field for MS SQL Server over ODBC. Task-Id: QTBUG-1363 Change-Id: I6673dafe75e3ef394d41e439adb45096c1421068 Reviewed-by: Bill King <bill.king@nokia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | Merge remote-tracking branch 'origin/master' into api_changesOswald Buddenhagen2012-04-1010-112/+123
|\| | | | | | | | | | | | | | | | | | | Conflicts: configure src/widgets/styles/qwindowsxpstyle.cpp tests/auto/gui/kernel/qwindow/qwindow.pro tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I624b6d26abce9874c610c04954c1c45bc074bef3
| * Convert Boolean value into integerHonglei Zhang2012-04-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | According to documentation, SQLite doesn't have a separate Boolean storage class. Instead, values are stored as integers 0(false) and 1(true). In QSqlQuery::bindValue(), if a boolean value is bound to a placeholder, it is converted to text true and false. This fix converts boolean value to integer 0 and 1. Task-number: QTBUG-23895 Change-Id: I4945971172f0b5e5819446700390033a1a4ce301 Reviewed-by: Michael Goddard <michael.goddard@nokia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * Documentation cleanupDebao Zhang2012-03-311-24/+0
| | | | | | | | | | | | | | They are comments of Qt3 support members which have been removed already. Change-Id: I4b3dfaac1e5e1c3c13b83e41d0505dd16a4b6a8e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
| * Add payload to QSqlDriver notification with PSQL implementation.Matt Newell2012-03-314-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Postgres async notifications can contain a payload parameter that is currently discarded. This patch provides the QSqlDriver api change necessary to deliver a payload with each emitted notification by adding a QVariant parameter to the notification signal. It also provides the implementation for the qsqlpsql driver. The qsql_ibase driver has been updated to reflect the change to the notification signal signature. The eventNotificationPSQL test in the qsqldatabase test has been expanded to test proper payload sending and receiving. All tests/auto/sql/kernel tests have been run with sqllite and postgres with no regressions. Task-number: QTBUG-13500 Change-Id: I9137f6acc8cfca93f45791ca930e0287d93d5d0d Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * Fix postgres notification support in the QPSQLDriver.Matt Newell2012-03-302-42/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a critical bug in the qsqlpsql driver where notifications aren't delivered when received. Any blocking libpq function(specifically PQexec) will read all the incoming data from the socket, including any pending notifications. This would cause the socket notifier to never be fired for incoming notifications that are already queued inside libpq. The qsqldriver test case was skipping the postgres notification test because of this bug, now its enabled and passing. In order to fix this bug I made a wrapper function for PQexec in QPSQLDriverPrivate that calls _q_handleNotification via QMetaObject::callMethod QueuedConnection in order to deliver pending notifications when control returns to the event loop. I also added a flag to ensure only one call is made each time the event loop is entered. Change-Id: I19f5297094ae7ae46bfb0717e4fca744d69f7b92 Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * Fix crash when an invalid filter is setHonglei Zhang2012-03-302-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | QSqlTableModel::headerData() generates a crash if an invalid filter is set. QSqlQueryModel::indexInQuery() should check the index value before applied to d->colOffsets[]. QSqlQueryModel::initRecordAndPrimaryIndex() is updated to sync the size of rec and colOffsets. Task-number: QTBUG-23879 Change-Id: Ic9f88bb288592aa6fb3c1415cc818632dadaab56 Reviewed-by: Michael Goddard <michael.goddard@nokia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * Update QSqlRelationalTableModel about reference table aliasHonglei Zhang2012-03-301-6/+11
| | | | | | | | | | | | | | | | | | | | | | The current documentation does not mention how the reference table name is aliased in the relational table model. This makes it difficult to use function setFilter(). This commit adds relevant information to the documentation. Task-number: QTBUG-15989 Change-Id: I02cbefb3f2b66c9772557a1fea3d93c2d1696ee9 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
| * Allow named bind values to be used multiple times per queryMatt Newell2012-03-301-35/+42
| | | | | | | | | | | | | | | | | | | | | | Prepared queries should be able to use a name parameter more than once. Currently this will result in undefined behavior and crashes. This patch fixes the bug and implements the needed test case. Task-number: QTBUG-6420 Change-Id: I07d6537e432a9b2781e9ef3d9f597bceb054527e Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
* | QSqlDriver functions made virtualMatt Newell2012-04-0210-207/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Certain QSqlDriver functions were marked to be made virtual in Qt5. subscribeToNotification, unsubscribeFromNotification, subscribedToNotifications, isIdentifierEscaped, and stripDelimiters. This patch makes them virtual and removes the no longer needed Implementation counterpart functions. It also updates the relevant drivers. This patch has no regressions on the tests in tests/auto/sql/kernel/, tested with sqlite and postgres. Change-Id: Ia2e1c18dfb803531523a456eb4e710031048e594 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | Merge master into api_changesKent Hansen2012-03-234-153/+141
|\| | | | | | | Change-Id: I93551e4d13a1b0815b359b9415060e9089477db1
| * QSql*Model: add SQL syntax helperMark Brand2012-03-224-86/+97
| | | | | | | | | | Change-Id: Ia53e30d7a2f2bb5b4f76c32fcf0fe526d1e4ab51 Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
| * QSqlTM/QSqlRTM: improve style and readabilityMark Brand2012-03-222-86/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | General changes: const, scope, braces, hash[] for clarity, comment wording and spelling. QSqlRelationalTableModel::selectStatement() readability: Renamed private method. QVector<Class>.value() already defaults to null object value, so there is no point in handling this case explicitly. Alias rec for d->rec added more noise than clarity. Using "tables" list only adds an extra step. Simple concatenation does the trick. Deduplicate code for building table expression and JOIN condition. Change-Id: Ia52afaf3c3937a26595d5ae867982664002562d8 Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
| * QSqlRTM: fix whitespaceMark Brand2012-03-221-3/+3
| | | | | | | | | | Change-Id: I0ed9ab93657d35a0e8c74469f72c77fe1fc4c7c1 Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
* | Merge master into api_changesKent Hansen2012-03-164-43/+98
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetatype.cpp src/gui/kernel/qplatformsurface_qpa.cpp tests/auto/corelib/tools/qtimeline/qtimeline.pro Change-Id: Iff3fff34eeeb06f02369767ddfce44cfde505178
| * QSqlTableModel::removeRows() enforce edit strategyMark Brand2012-03-151-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For OnFieldChange and OnRowChange, we don't want more than one row in the cache with uncommitted changes. This could happen if deletion in the database fails while other changes are pending. Chosen solution is to return false if other rows have pending changes. Also, we only allow 1 row removed at a time. Updated test, changes and documentation. Change-Id: I68baf6d221789b4754e891535070011c759a2155 Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
| * QSqlTableModel::setData(): no longer autosubmit for OnRowChangeMark Brand2012-03-151-29/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The model can never do a good job of knowing when user moves to a new row in the view. Faking it by detecting when another row is changed was not a good solution because it cannot detect when the last edited row is left. Either the view should automatically submit when the user leaves a row or the application should provide a way to submit. This change made it possible to reuse the logic of flags() in setData(). Change-Id: I2550e5b113bceba1a852fc21203babeca07c5748 Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
| * QSqlTableModel: disallow insert if changes are pendingMark Brand2012-03-151-7/+9
| | | | | | | | | | | | | | | | For OnFieldChange and OnRowChange, inserting rows should not be allowed if there are pending changes in cache. Change-Id: Ia794332959a35a1de87e798ba1a74ace3dfae68f Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
| * QSqlTableModel::setData()/setRecord(): fix incorrect rowMark Brand2012-03-151-25/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For OnFieldChange and OnRowChange, before submitting new changes, setData() and setRecord() attempt to submit pending changes and revert them upon failure. However, they fail to consider that reverting pending insertions removes rows from the model. As a result, the new change can be applied to a row higher than intended. One possible solution would be to adjust the targetted index for the removed rows, so that the intended row is affected by the new change. But this still causes the strange editing experience as rows jump up just as they are being edited. It does not seem right in the first place for the model to initiate reverting changes. It should be up to the application to decide what to do when data cannot be committed. In particular, setData() and setRecord() should not have the side effect of reverting already pending changes. The chosen solution is simply to refuse new changes that don't make sense for the edit strategy. For OnFieldChange, flag() will indicate read-only when editing is blocked by a pending change. Since setData() and setRecord() submit data immediately for OnFieldChange, it no longer makes sense to resubmit changes automatically before a new change. For OnRowChange, setData() keeps the behavior of automatically submitting a pending row before starting on a new row. This is historical behavior and is probably motivated by the fact that QTableView does not automatically call submit() when editing leaves a row. The obvious shortcoming of this is that the last row to be edited will not be submitted automatically. It also prevents us from flagging rows other than the pending row as read-only. For OnRowChange, setRecord(), being row-oriented by nature, should submit the change immediately rather than waiting for the next call to setRecord(). This makes setRecord() consistent with insertRecord(). Change-Id: Icb4019d8b7c53a7ee48f8121a7a525e8bc35d523 Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
| * QSqlTableModel bugfix: consider uncached rows submittedMark Brand2012-03-151-0/+2
| | | | | | | | | | Change-Id: I7ec0529b88fd8e3ae0cf8dadfcb5899579e52745 Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
| * Fix memory leak when sqlite3_open_v2 failsHonglei Zhang2012-03-131-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | According to SQLite documentation, a database connection handle is usually returned, even if an error occurs. This behavior has caused Qt to leak memory when opening a database is failed. Now, even if sqlite3_open_v2() does not return SQLITE_OK, Qt tries to release SQLite database handle by calling sqlite3_close(). Task-number: QTBUG-15773 Change-Id: I6538e2897216828a9cfb95b7d4a5cec437aa6c28 Reviewed-by: Mark Brand <mabrand@mabrand.nl> Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
| * QSqlTableModel::isDirty(): new overloaded methodMark Brand2012-03-122-0/+20
| | | | | | | | | | | | | | | | | | | | | | Checks if model has any changes to submit. Includes new test covering isDirty(index) as well the new overloaded function. Task-number: QTBUG-3108 Change-Id: I0ccbda45d5d9f06434cf1e1c037a9efb76d0cc37 Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
* | Merge remote-tracking branch 'origin/master' into api_changesLars Knoll2012-03-121-1/+1
|\| | | | | | | | | | | | | Conflicts: tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp Change-Id: I884afc3b6d65c6411733a897a1949e19393573a7
| * QSqlTableModel::indexInQuery: fix inserted row accountingMark Brand2012-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Commit b979956ec46093e5668c2b264f9b68da3cbb0326 introduced a distinction between rows that have a pending INSERT operation and rows that have already been inserted in the database but still are in the change cache. Both cases are rows that are not in the underlying query. Unfortunately, we overlooked a case where the point of the test is whether the row is in the query. Change-Id: I0f58bed232d9336fed6e67c3d140fd580ec35868 Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
* | QtSql: make some constructors explicitMarc Mutz2012-03-123-5/+5
|/ | | | | | | | | | This is a semi-automatic search, so I'm reasonably sure that all the exported ones have been caught. Change-Id: I3a79f66f9705bc991175f396138efe3088727a85 Reviewed-by: Mark Brand <mabrand@mabrand.nl> Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
* QSqlTableModel::selectRow(): complete documentationMark Brand2012-03-071-0/+2
| | | | | | | | Mention in changes and document Qt version (merci à dfaure). Follow-up to 291e2c7d5416af4d16dc0a6e60df7980ba745a3d. Change-Id: Ie5626e9cd268812c1173ca494ccd8d6bd9be2687 Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
* Improve type detection for query resultsAndy Shaw2012-03-071-4/+29
| | | | | | | | | | | | | | When an aggregate function is used for a column in a SQL resultset then it should ensure that the right data type is reported for that column. This also concerns expressions when the returned column does not map directly to a table column. Test included for this. Task-number: QTBUG-22038 Change-Id: I07487694c0ed393d46af06e232914fe923356a99 Reviewed-by: Mark Brand <mabrand@mabrand.nl> Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
* QSqlTableModel: use selectRow() for field and row edit strategiesMark Brand2012-03-071-12/+24
| | | | | | | | | | | | | | | | Calling select refreshes the query data but disrupts view navigation. For OnFieldChange and OnRecordChange it makes sense to only select the row in question. This does not disturb view navigation. Assume disruption of view navigation is not a problem for OnManualSubmit because the user or application decides when submitAll is called. Task-number: QTBUG-2875 Change-Id: I1e5f68668fb9102f6296d67d543e80daa403f1c4 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* QSqlTableModel: long live selectRow()!Mark Brand2012-03-073-0/+58
| | | | | Change-Id: If26dbcc8a1e8ef1376ef7a688c946ce5270e5706 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* QSqlTableModel: handle changes between submit and selectMark Brand2012-03-072-28/+71
| | | | | | | | | | | | | | | | | | | | Once an insert has been submitted, the cached record behaves like an update. For row bookkeeping, we still have to remember that it was originally inserted and is not in the query rows. Between submitting a delete and selecting, we remove the values from the deleted record. This causes a blank row to be displayed. Read-only flag is set for cells in deleted row. Reverting between submit and select means going back to the last submitted values. When removing rows, it's better to process from highest row numbers to lowest. This avoids complications with higher rows shifting down when lower rows are removed. Change-Id: I8752fa11f7a1b88f2a71b9e03a020ac37e62487f Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
* QSqlTableModel::data(): use cached values when availableMark Brand2012-03-061-23/+3
| | | | | | | | | | Simplify logic. If the record is in the cache, even untouched values should be there. This is also necessary for getting the most up-to-date values between submitting and the next select. Change-Id: I8578d96229797ce9fb0d07fe456301358f2be071 Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
* QSqlTableModel: derive primary values from database valuesMark Brand2012-03-062-10/+13
| | | | | | | | | | | Primary values are used to map a row in the model to a row in the database table. It is critically important between submitting a change and the following select (which refreshes the query) to have updated primary values. Otherwise, if the change affected the primary values, additional changes before select will misbehave. Change-Id: I5d08dd70ac5d3f06cd9d3186a439f4c80a037c2d Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* QSqlTableModel: mirror database values in change cacheMark Brand2012-03-062-7/+11
| | | | | | | | | | | Between submitting and the next select, these values will be more up-to-date than those that could be obtained from the query. This will be useful for constructing primary values and reverting changes made after submitting. Change-Id: I8317617f3e7043ad0b79b333731c55fb88aef171 Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
* QSqlTableModel: remove unnecessary parameter from setSubmitted()Mark Brand2012-03-062-2/+2
| | | | | Change-Id: I6d23788163ffd6ba7a8f01ed40910d861ff92703 Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
* Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-024-120/+120
| | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QSqlTableModel: unify code for cache-clearing before selectMark Brand2012-02-281-19/+12
| | | | | | | | | | The code in submitAll() had the same goal as the code in select, so it has been unified. The new code in select() avoids sending lots of dataChanged() signals for rows that are going to be removed by QSqlQueryModel anyway. Change-Id: Ic22e038223720185e47ed0cc573147745ecc8fc9 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* QSqlTableModel::isDirty(): simplify and improve logicMark Brand2012-02-281-17/+8
| | | | | Change-Id: Ic1332befa9078a94f872e38ff779e5b4cec7c100 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* Clean up some Q_WS_WINDebao Zhang2012-02-241-2/+2
| | | | | | | | Q_WS_WIN does not exist any more. Change-Id: Icb7f542cfcd4d21e994f246ff665583cb6b57610 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* QSqlTableModel: rename parameter to avoid name clash with methodMark Brand2012-02-231-5/+5
| | | | | Change-Id: Ib8fa6b0ca71ffdd9f1f8416c448b5c830988ed08 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* QSqlTableModel: avoid extra QMap lookupMark Brand2012-02-231-7/+5
| | | | | | | | | The consensus on #qt-labs seems to be that there is little or no point in checking with contains() before using value(), even if the map does not contain the key in most cases. Change-Id: I34740a91d5c3af65e20937a5ae3b4bab32406440 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>