summaryrefslogtreecommitdiffstats
path: root/src/sql/models/qsqlrelationaltablemodel.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Fix broken linksSze Howe Koh2013-11-051-1/+1
| | | | | | | | Task-number: QTBUG-33360 Change-Id: Ic944cb2f575c35ebad64852ef5fc44a50ac03571 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-4/+4
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Docs: Fix some warningsChristian Stenger2012-12-061-0/+1
| | | | | Change-Id: I3898c89e54aa671ff8cb1b25c49cfe3835ab9384 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* doc: Fix a few doc errors for QtSQLTor Arne Vestbø2012-10-121-7/+7
| | | | | | | | | | | 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>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | 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>
* Fix doc errors.Frederik Gladhorn2012-08-281-2/+2
| | | | | Change-Id: I38d01d3b5d2b9b15edd389ea17142bd75f00e135 Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
* Doc: Fix typo foreigh -> foreignSergio Ahumada2012-07-161-1/+1
| | | | | | Task-number: QTBUG-23260 Change-Id: I922a8b5cba5d8784305fb1779ccd352ab2ece365 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Doc: Fix most qdoc errors in QtSql.Casper van Donderen2012-04-281-6/+6
| | | | | | | | | - 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>
* 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>
* QSql*Model: add SQL syntax helperMark Brand2012-03-221-50/+26
| | | | | Change-Id: Ia53e30d7a2f2bb5b4f76c32fcf0fe526d1e4ab51 Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
* QSqlTM/QSqlRTM: improve style and readabilityMark Brand2012-03-221-64/+47
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-021-7/+7
| | | | | | | | | | | 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>
* QSqlRelationalTableModelPrivate: simplify field name translationMark Brand2012-02-151-9/+6
| | | | | | | | | | | | It's not appropriate to use indexInQuery() here. First of all, the row might be an inserted row, and thus not be in the query. The intent was probably to get the column position in the query, but this is certainly not row dependent. Furthermore, if there are inserted or removed columns, these are managed within QSqlQueryModel. Change-Id: I89668655b263747a5b849136404112e911722b3d Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* QSqlTableModelPrivate::ModifiedRow guard private dataMark Brand2012-02-071-3/+3
| | | | | | | | | | | | | | | | Even though ModifiedRow is not part of the public API, guarding its data helps make clear the intended patterns of use. "op" and "primaryValues" are read-only after construction. setValue() encourages maintainers to let ModifiedRow manage the "generated" flags of the record. The primeInsert() signal still exposes the actual record, including the "generated" flags, which is the justification for recRef(). Change-Id: I16d1610a8f9233af78b90662b08706b48ea19c41 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* QSqlTableModelPrivate: deduplicate field stripping logicMark Brand2012-02-071-3/+1
| | | | | Change-Id: Ic969a192644e84d78558da0f19e588033e4af43d Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* ModifiedRow: use for all edit strategiesMark Brand2012-02-051-23/+9
| | | | | | | | | | | | Previously ModifiedRow was used only for OnManualSubmit and a seperate buffer and utility methods were used for OnFieldChange and OnRowChange. Also, initialization of the edit buffer is done by ModifiedRow instead of a helper function. Change-Id: I3316498e5bb10c416138ca14c3a7f8b143c8e544 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* use nameToIndex() instead of duplicating codeMark Brand2012-01-271-1/+6
| | | | | Change-Id: If55541aa8a2345f90984d8b82bee0c3ebb01a605 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix documentation.Frederik Gladhorn2012-01-061-2/+2
| | | | | Change-Id: Id54263f408e29ed3b9d06712e39759485a42b869 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QSqlRelationalTableModel doesn't follow relations on the first columnHonglei Zhang2011-12-021-1/+1
| | | | | | | | | | QSqlRelationalTableModel doesn't follow relations on the first column of a table. The DisplayRole and the EditRole for indexes on column 0 are always the same. The bug is found in QSqlRelationalTableModel::data. Task-number: QTBUG-20038 Change-Id: Ie1e98b5f46ffc171113f2d51b9b19ff5febb1c3c Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* Make it possible to update a related table after an external updateAndy Shaw2011-07-291-2/+34
| | | | | | | | | | | | | | | | | | | When a table that is related to in a QSqlRelationalTableModel gets updated in some way (e.g. a new row, or the data is changed) then the related model could not be updated without recreating the QSqlRelationalTableModel. Now, to get around this, select() can be called on the related model to get it to be updated. Task-number: QTBUG-7885 Reviewed-by: Charles Yin Reviewed-by: Michael Goddard Change-Id: Ic589e840234f3a809bcb112a807a87afe0bc25ca (cherry picked from commit 2c60a4f67f9fb02f3b711fe749b2f293a07b4e02) Reviewed-on: http://codereview.qt.nokia.com/2224 Reviewed-by: Charles Yin <charles.yin@nokia.com>
* Add docs for QSqlRelationalTableModel::JoinModeCharles Yin2011-07-201-0/+12
| | | | | | | | | | | | Task-number:QTBUG-8217 Reviewed-by:Michael Goddard (cherry picked from commit e2e62bc810d21fecc9ed1d1db486b529b760d292) Change-Id: Ie2af750c3a64aa634e11617cf9b3f9e7bdcf3a5f Reviewed-on: http://codereview.qt.nokia.com/1854 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Charles Yin <charles.yin@nokia.com>
* Fixed behavior on NULL foreign keysDaNiMoTh2011-07-201-12/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using a simple INNER JOIN, like: SELECT a,b,rel.c FROM table1, table2 WHERE (table1.smthing = table2.smthing) which doesn't show row where foreign keys are NULL, allow use of LEFT JOIN like: SELECT a,b,rel.c FROM table1 LEFT JOIN table2 ON table1.smthing = table2.smthing The trick works also for multi-relational tables. Just remember to use the new API setJoinMode. Signed-off-by: DaNiMoTh <jjdanimoth@gmail.com> Task-number:QTBUG-8217 Reviewed-by:Michael Goddard Reviewed-by:Charles Yin Merge-request: 2576 Reviewed-by: Charles Yin <charles.yin@nokia.com> (cherry picked from commit c4280dbd9bb37cca21d007f5f8b9217f80b44043) Change-Id: I349f9418e4859923977942add59872b000cac2c5 Reviewed-on: http://codereview.qt.nokia.com/1853 Reviewed-by: Charles Yin <charles.yin@nokia.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+753
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12