summaryrefslogtreecommitdiffstats
path: root/src/sql
Commit message (Collapse)AuthorAgeFilesLines
* Always use QAIM to get the default flags.Stephen Kelly2012-11-281-2/+2
| | | | | Change-Id: I801f5c8023e3e3672fde28139a7f34f640e650f5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* tr()-Fix: Do not add up translateable strings.Friedemann Kleint2012-11-261-2/+1
| | | | | | | | | Placeholders might go to a different position in translated strings. Change-Id: Id6a84ea931dc0487bd72eb8d01669369a3dce9c6 Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Fix example paths in example manifests that are used by Qt Creator.Eike Ziller2012-11-261-0/+2
| | | | | | Task-number: QTBUG-27801 Change-Id: I345c009fc0e4e1c1eabb43ad142e3b474e7a6fee Reviewed-by: hjk <qthjk@ovi.com>
* create interface QSqlDriver::cancelQuery()Sune Vuorela2012-11-202-1/+27
| | | | | | | | | This is useful for canceling a long running sql query. Note that it needs support from the individual drivers. Change-Id: Ia170a70487ff4ee13c85f12bc13e62fb198617fe Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Merge branch 'newdocs'Eskil Abrahamsen Blomfeldt2012-11-206-37/+30
|\ | | | | | | | | | | | | | | | | | | | | Added prepare_docs to qt_build_config.prf (it was added directly in configure in the source branch) Conflicts: configure tools/configure/configureapp.cpp Change-Id: I1337c69fc62b1c934e3e39b4409e4857440c9db8
| * Doc: Cleaning up QHP information in module configuration files.Jerome Pasion2012-11-071-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a common standard among all Qt modules. These changes affect the final .qch file for each module. Changes: 1)URL in qt-project.org is confirmed by DevNet maintainer url = http://qt-project.org/doc/<module> 2)Landing page title mapping indexTitle = landing page 3)"C++ Classes" as a child node. The list of C++ classes and the titles are specified in the wiki. 4)Removed extra subprojects. They are not needed for now. Each module may need additional nodes. Change-Id: I1825476c21fe9aaddc9d6b512ff74229f17271a0 Reviewed-by: Martin Smith <martin.smith@digia.com>
| * Merge branch 'master' of ssh://codereview.qt-project.org/qt/qtbase into newdocsJerome Pasion2012-11-022-12/+0
| |\ | | | | | | | | | Change-Id: I7e6cee190a341901dfbf8effb54ebccb91bf7a17
| * | Doc: Removed the HTML template from the .qdocconf filesJerome Pasion2012-10-261-1/+0
| | | | | | | | | | | | | | | | | | | | | -qt-module-defaults.qdocconf already contains the HTML template. Change-Id: I5757741166f0f688ce0e8a4e77ed45fd4d72f1c7 Reviewed-by: Martin Smith <martin.smith@digia.com>
| * | Merge remote-tracking branch 'gerrit/master' into newdocsTor Arne Vestbø2012-10-262-3/+1
| |\ \ | | | | | | | | | | | | Change-Id: I10cf9f915c602c8e5a0e7d7c9e17b7bc5ca00640
| * \ \ Merge remote-tracking branch 'gerrit/master' into newdocsTor Arne Vestbø2012-10-162-11/+7
| |\ \ \ | | | | | | | | | | | | | | | Change-Id: If2168c519daf45390af04af9ef9722770453a493
| * | | | doc: Add a bunch of missing dependsTor Arne Vestbø2012-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I32c3730f8181d73a7c8e36ef382c74b8da754269
| * | | | doc: Fix a few doc errors for QtSQLTor Arne Vestbø2012-10-126-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The examples include path already contains 'sql', so we can't prefix the includes with 'sql' as well. Changing the include path to also include the parent examples directory is not an option, as qdoc will then try to generate output for example single example. Change-Id: Ifae07af86e60e6105a0625f29fbd6bc8f73b2550 Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | | | | SQL: Fix OCI driver's compile errors.Caroline Chao2012-11-202-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-27979 Change-Id: I4ae4cdba855c05bc6fab0f845ff16a96c8119fdb Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | | | Fix error reporting in TDS SQL driver.Aaron McCarthy2012-11-181-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The error and message handlers used by the freetds library were getting reset to back to the default every time a database was opened. The Qt TDS SQL driver was calling dbinit() from QTDSDriver::open(). This had two problems: 1. dbinit() would reset the error handler previously set by a call to dberrhandle(). A db error would then cause the application to abort. 2. freetds expects dbinit() and dbexit() to be called symmetrically. Opening multiple database connections would result in freetds not cleaning up on application close. Solved by moving the dbinit() call into the QTDSDriver constructor. Change-Id: I59018d83238672c903b96a4d7f3f21b664c3ff4c Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | | | Fix msvc2010 compiler warnings of switch with default but no case labelsThiago A. Correa2012-11-188-32/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I5de4d7405131314c4e2bdb1222d2bb1a2d34a993 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | | | fix binding of bool type in mysql driverMark Brand2012-11-091-1/+6
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MYSQL_TYPE_TINY should be used for binding bool input value. MYSQL_TYPE_LONG might be too big for bool, resulting in bools being saved in the database as int 127. The problem was not specific to the vendor's BOOL column type. http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html http://dev.mysql.com/doc/refman/5.0/en/c-api-prepared-statement-type-codes.html Added generic autotest to make sure that binding bool works. All drivers should pass this test. Task-number: QTBUG-27763 Change-Id: I4e69f8e3b32fffb702ec9fa8a80ff5c50dea954b Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | | Enable the "#include <QSql>" camel-case header, for the QSql namespaceSze Howe Koh2012-10-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sync.profile Perl script will now generate the "QSql" header file during compilation. By removing the \inheaderfile command, the documentation will now display the namespace's own name as the header (i.e. "QSql" in this case). Previously, the only documented way to include the namespace was to include the whole module, which is expensive. This change also makes QSql consistent with other namespaces, such as QSsl and QAudio, which have their own dedicated camel-case headers. Part of the Header Consistency Project (http://lists.qt-project.org/pipermail/development/2012-October/007421.html) Change-Id: Ibb82d442956e767c13b82f1e552aabdf2e8ff110 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | | QSqlRelationalDelegate: remove setEditorData reimplementationMark Brand2012-10-261-11/+0
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | Since commit 84787d82ee9369b2a83c5b0568ee62ab602a5528 QItemDelegate::setEditorData() works out of the box on QComboBox. Change-Id: Ic9839f7eccccbdb787ce204fe98311335ee16b92 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* | | Doc: Fix small capitalization error for the Qt SQL module header.Sze Howe Koh2012-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | The header file is named QtSql, not QtSQL. Change-Id: Ia3634c80d73f04fd27256f392cfed2068eeb9bc5 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | | remove explicit load(qt_build_config)s from the librariesOswald Buddenhagen2012-10-191-2/+0
| |/ |/| | | | | | | | | | | .qmake.conf (and previously .qmake.cache) already does that for us. Change-Id: I06cc01fa45921d7bd66dda7a0f88729faeff37bd Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | QtSql: Correct documented default precision policy.Mark Brand2012-10-151-8/+4
| | | | | | | | | | | | | | | | Follow-up to commit c9f77564df14f91276e9ca693a9b3f339dab9334 Task-number: QTBUG-27482 Change-Id: I17c12ee14d4609bccbe67bba2581f13d72c069ae Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* | correct spelling in QtSql documentationMark Brand2012-10-151-1/+1
| | | | | | | | | | | | Change-Id: I69e4178bbe967a70b1141122639883b5cbacd924 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Bill King <bill.king@nokia.com>
* | QSqlTableModel: let select() and selectRow() be slotsMark Brand2012-10-141-3/+3
|/ | | | | | | | | It's convenient to be able to connect a button to select() and signals that provide a row to selectRow(). Change-Id: I520d5564943f679ec9e68331878a211dd52b4a06 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: David Faure <david.faure@kdab.com>
* Modularize documenation buildTor Arne Vestbø2012-10-102-6/+4
| | | | | | | | | | qdocconf files can now reference $QT_INSTALL_DOCS to pick up e.g. global includes, instead of using relative paths. Qt modules will automatically get a doc target that builds and installs into the right place (including supporting shadow-builds) if they set QMAKE_DOCS before loading(qt_module). Change-Id: Ia408385199e56e3ead0afa45645a059d1a8b0d48 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* QSqlQuery::value string overloadThiago A. Correa2012-10-082-0/+19
| | | | | | | | | | Introduce value overload to take field name as a parameter. This allows for terser application code that avoids explicit calls to QSqlRecord::value(). Change-Id: I02b6712cd5ec41633b902714315b5716c17d1a9b Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Fix QSqlQuery::value to use proper index checkThiago A. Correa2012-10-051-1/+1
| | | | | | | | Change the validation of index parameter to use -1 constant instead of QSql::BeforeFirstRow which is unrelated to field index Change-Id: I43b42bc7ce717bcd9ddc987d2e716f1672c00775 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Qt SQL: Cleaned up documentation group membership and brief desc.Jerome Pasion2012-10-051-5/+6
| | | | | | Task-number: QTBUG-27449 Change-Id: I052c7c9beab344e6c0902f9440c1d6b74e15b0b6 Reviewed-by: Geir Vattekar <geir.vattekar@digia.com>
* QSqlTableModel::selectRow(): don't expand cache if there is no changeMark Brand2012-10-051-4/+26
| | | | | | | | 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-3/+11
| | | | | | | | | | | | | | 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-5/+7
| | | | | | | | | | | | | | | | 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/+6
| | | | | | | | | | | | | | | | | | | | | | 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>
* QSqlTableModel: fix segfault when overriding selectRow()Mark Brand2012-10-051-9/+14
| | | | | | | | | | | | | | | | | The STL-style iteration over the cache in submitAll() assumed the iterator would remain valid until reaching cache.end(). This failed to consider that virtual selectRow() might be overridden so that it removes rows from the cache. For example, it might call select() which would empty the cache. The new approach checks at each iteration whether the row is still in the cache. Using foreach here is justified by its fitness for purpose and readability. New test included. Change-Id: Idee8807ede239c3ba56ff1604574c49f47385ad2 Reviewed-by: David Faure (fixes for KDE) <faure@kde.org>
* fix #includesMark Brand2012-10-021-1/+2
| | | | | | Change-Id: Ia33d7ef08e43bad95d57823e37757a09e53493b9 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* fix indentationMark Brand2012-09-281-3/+3
| | | | | Change-Id: Iebec20c1be5a0610007a8e7ffd2646bda7f2785d Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Remove duplicate words and punctuation from documentation.Mitch Curtis2012-09-261-1/+1
| | | | | Change-Id: I5550c62d412510bc2c5acceb2cae7d2f2ef6a8d3 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* fix incorrect uses of qmake in documentationJoerg Bornemann2012-09-252-6/+6
| | | | | | | | | Assigning backslashes to qmake variables yields a warning these days. Use forward slashes as they get automatically converted. Task-number: QTBUG-27325 Change-Id: I804fa641064ce183e9794026ad1dbc91725d334d Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QSqlTableMode::selectRow(): lack of WHERE clause is an errorMark Brand2012-09-241-1/+9
| | | | | | | | | Since we only want one row, never ever run a SELECT without a WHERE clause. Change-Id: I40a78935f5573111faa3922eae97e6d5961be5f2 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QSqlTableModel::selectRow(): reduce scope of QSqlQueryMark Brand2012-09-241-6/+8
| | | | | | | | | | It's good to clean up the query before emitting signals about the updated row. It's possible that connected slots will call selectRow() again for other rows. Change-Id: I482fe2dd58218f53567ce8725ee591ce2eeda348 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* QSqlTableModel::selectRow(): fix failure on uncached rowsMark Brand2012-09-242-7/+21
| | | | | | | | | | | | | | | | | | | | This method was originally intended for refreshing rows after submitting changes. It should also work for refreshing rows that are unchanged (i.e., not cached), but did not because constructing the primary values depended on the cache. As a consequence, the WHERE clause for the query was not created. Fixed by deriving primary values for uncached rows from the query record. Note that the cache is still authoritative for rows it holds. This is important because the prmary values there may differ from the original query record due to changes to columns of the primary key. Includes new test. Change-Id: I41cca2cbf26019d4b495ffa6d876e2b55ec57803 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2265-1330/+1330
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Move opengl/wid/net example docs to proper folders.Frederik Gladhorn2012-09-211-4/+4
| | | | | | Change-Id: I846439a9cf7ad965ed27a00f98dbc4ff97abe73b Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* remove mentions of borland from project filesOswald Buddenhagen2012-09-194-7/+3
| | | | | Change-Id: I3049b24ae287bee50aca1de06664a2309df69edf Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* sql: Include own headers firstSergio Ahumada2012-09-193-5/+5
| | | | | | | | cpp files should include their own headers first (but below config.h) Change-Id: I225bc0f09988167ae7f938f7f21a77d05a3d191b Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Do not include /examples in qdocconfs.Frederik Gladhorn2012-09-111-1/+1
| | | | | Change-Id: I84a925a8be4964fae667f5a2500157283a8057d2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Doc: Centralize more common settings in 1 global qdocconf.Casper van Donderen2012-09-111-36/+1
| | | | | | | | | | All qdocconf settings that should be used by all Qt modules are now in qt-module-defaults.qdocconf. Change-Id: I2a0315a55db3fcbb0160c4392d2da98611043d83 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Check for C++ operators that should be 'const'Sergio Ahumada2012-09-082-4/+4
| | | | | | | | Make sure all C++ class comparison operators are const. Change-Id: Ib4a66f2afe6c62f437dae1ecde94287d3db8442d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: David Faure <faure@kde.org>
* Use QStringList::join(QChar) overload where applicable [QtSql]Marc Mutz2012-09-032-2/+2
| | | | | | | | | | | This is an automated change performing the following replacements: join\("(.)"\) -> join('\1') join\(QLatin1String\("(.)"\)\) -> join(QLatin1Char('\1')) join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1')) Change-Id: Ie395d82d17710683968d006d22de313ef49dc6e5 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Doc: Fix docbuild when not using -developer-build.Casper van Donderen2012-09-011-2/+2
| | | | | | | | https://codereview.qt-project.org/#change,33974 only works in the case of a developer build. Not in a normal prefix build. Change-Id: I3a3e5029cefaa9f83c5deb71665f0efa9d812819 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Doc: Simplify qtbase qdocconfs.Casper van Donderen2012-08-311-15/+2
| | | | | | | | | | We should be using the global qdocconf for the common variables. This change also allows you to just specify -installdir without using a templatedir. Change-Id: I207d279d9b5199212e896fc5ccab5c212b1896c6 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* QSqlQueryModel: suppress insert and remove signals while resettingMark Brand2012-08-302-4/+86
| | | | | | | | | | There is no need to emit signals for inserting and removing rows and columns while resetting the model. Suppress these signals in such a way that subclasses can benefit without worrying about it. Change-Id: I04447c87173be54a7323b97608cdd40ae245b80b Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>