Commit Graph

413 Commits

Author SHA1 Message Date
Frederik Gladhorn
e6286ca289 Merge remote-tracking branch 'origin/release' into stable
Manually fixed up: isES -> isOpenGLES
src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp

Change-Id: I57d2ef26c3d4a7b40ace09f4e8560b7686650ea5
2014-05-03 00:56:41 +02:00
Frederik Gladhorn
ccc6efb6e9 Merge remote-tracking branch 'origin/release' into stable
This merge adds the opengl rename.

Change-Id: I84ea0b6abee9780ebb2cf3f64ab9e3fdf2acab3e
2014-05-01 13:08:42 +02:00
parihaaraka
f1eefd6cf9 Fix PSQL column's metadata
Fixed libpq's PQfmod() interpretation inside QPSQLResult::record()

Task-number: QTBUG-12477
Change-Id: I0e4c94ca1b06fd6a8e5b5702235cdd6d9736f8bf
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-04-29 14:42:26 +02:00
Mark Brand
373d858812 [QtSql][QSqlTableModel] fix failure to refresh in selectRow()
Caused by missing braces, leaving the break outside the scope of the if clause.

Task-number: QTBUG-38509
Change-Id: I6b0a7f34512a3a9b0fbd790116f81f54f4a91cf0
Reviewed-by: Tobias Koenig <tobias.koenig.qnx@kdab.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2014-04-27 20:39:11 +02:00
Israel Lins Albuquerque
3e6e70bddd [QSqlQuery] misbehavior of seek in special query positions
When QSqlQuery::at() == QSql::BeforeFirstRow and seek(1, true) (seek to
next record) is called the expected result is go to first row.
When QSqlQuery::at() == QSql::AfterLastRow and seek(-1, true) (seek to
previous record) is called the expected result is go to last row.

But in all cases the first and last are skipped.

Change-Id: I584138b3d397ce1c790bf89688ee92289a99611c
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-04-26 20:22:42 +02:00
Olivier Goffart
89ecac4607 QSqlError: Mark deprecated functiond with QT_DEPRECATED
And move the default argument from the deprecated constructor to
the new one

Also make sure that the error number is consistent across the
two constructor

Change-Id: I3721266b39ab493f0add35b2d1f892b2f6094992
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-04-25 06:37:06 +02:00
Friedemann Kleint
d5ff16bc8e Fix access of tmpStorage in QODBCResult::exec().
Instead of using a list and appending / popping of elements, use
a vector of constant size and access via index to avoid
bookkeeping errors.

Task-number: QTBUG-37831

Change-Id: Icb5a182626c63e693b04daaf7a2f70997d9aeae1
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-04-03 08:20:48 +02:00
Israel Lins Albuquerque
075c876f9a [QtSql]QIBASE]add support for prepared queries in numRowsAffected
Prepared queries need to be handled as procedures.

Change-Id: I4b4d7743fe45c416ca83ceb942aa48d79731f2f8
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-03-29 08:46:00 +01:00
Friedemann Kleint
3ed2ec1487 Fix some documentation errors.
Correct links and fix typos, remove obsolete documentation,
fix some snippets, mark some classes as internal.

Change-Id: I9a3266605f060783413d32740057a57a820c8929
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-03-24 16:42:02 +01:00
Tobias Koenig
1f6e461533 Fix positional binding values order in QSqlQuery
Adapt the stringification code, that is used to produce the
keys for QSqlQuery::boundValues() return value, to keep the
right order of the binding values.

Task-number: QTBUG-12186
Change-Id: Ic11a455bfd9ffd1418b1b021ce5cf78cae9b4504
[ChangeLog][QtSql] Fixed the order of values with positional binding in a QSqlQuery
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-03-20 10:36:34 +01:00
Friedemann Kleint
0d50efeae9 Fix QByteArray memory corruption in QIBaseDriver::open().
Rewrite code to use QByteArray::reserve(), QByteArray::append()
instead of memcpy().

Task-number: QTBUG-37508
Change-Id: I16ead153f33fa5a34bc01ee27ae4cd1b8993b65e
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2014-03-19 04:17:01 +01:00
Sergio Ahumada
7e872de76e Fix some typos
Change-Id: I7dbe938bff5ac3ab50a0197f94bdb2f6c22fbd16
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
2014-03-03 18:24:29 +01:00
Frederik Gladhorn
a1fe728fa5 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/gui/kernel/qguiapplication.cpp
	src/plugins/platforms/android/androidjnimain.cpp
	src/plugins/platforms/android/qandroidplatformintegration.cpp
	src/plugins/platforms/android/qandroidplatformintegration.h
	src/plugins/platforms/android/qandroidplatformopenglcontext.cpp
	src/plugins/platforms/cocoa/qcocoawindow.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/sql/doc/src/sql-driver.qdoc
	src/widgets/widgets/qtoolbararealayout.cpp

Change-Id: Ifd7e58760c3cb6bd8a7d1dd32ef83b7ec190d41e
2014-02-07 13:07:25 +01:00
Frederik Gladhorn
c30fc6949a Merge remote-tracking branch 'origin/release' into stable
Change-Id: I4680723bef393a15d5aa63b9dd7d5fbb599bd9fa
2014-01-27 18:58:04 +01:00
Kai Koehne
c071b165a3 Doc: Remove section on how build the MySQL driver for MinGW users
The section is clearly outdated. It references MinGW from mingw.org, which
we don't support anymore. With a more modern MinGW you can just use the
recipe to link against the prebuilt binaries the same way we do describe
for MSVC.

Task-number: QTBUG-17268
Change-Id: I15b96fd328605b60d1494a703b9005e2c16aea39
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-01-25 21:34:01 +01:00
Frederik Gladhorn
9033977d39 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/corelib/global/qglobal.h
	src/corelib/tools/qstring.cpp
	src/gui/image/image.pri
	src/gui/image/qimage.cpp
	src/plugins/platforms/cocoa/qcocoawindow.h
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
	tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp

Change-Id: I3b9ba029c8f2263b011f204fdf68c3231c6d4ce5
2014-01-20 18:18:59 +01:00
Kai Koehne
278152fffd Replace win32-g++ with mingw scope
Commit 773dd01 introduced a general mingw platform scope, which
is cleaner and more flexible than matching the spec name.

Change-Id: Ie3a9cb791a83f7c8a51bc4e23069190c452ab521
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-17 12:08:24 +01:00
Jędrzej Nowacki
3558c0cd74 Minor optimization use QString midRef instead of mid.
It doesn't create a temporary string.

Change-Id: If5c540422f69e573107d1f5a886ac7174ae99853
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-01-15 15:58:00 +01:00
Oswald Buddenhagen
882bf3475c expand tabs and related whitespace fixes in *.{cpp,h,qdoc}
the diff -w for this commit is empty.

Started-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-01-13 22:46:50 +01:00
Marcel Krems
6c4c2b752c Move struct declaration out of the union to avoid a compiler warning.
Clang 3.3+ warns about this being an extension:
qsqlerror.h:101: warning: anonymous types declared in an anonymous union are an extension [-Wnested-anon-types]

Change-Id: I0350b977ff85558338b3b9db53d3fce7facb7635
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-12-31 22:27:07 +01:00
Marcel Krems
b276f4e5e8 Remove additional spaces from indentation.
Change-Id: I1f76ed4e2eff64dc133a1fd30a8dc5fd5eb4710e
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-12-31 22:26:27 +01:00
Frederik Gladhorn
f0fbff4c90 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I2defae1904154283446b069d151c3ef57302ec7b
2013-12-24 00:56:59 +01:00
Marcel Krems
14170bbf09 QSqlError: Set error code for psql-driver.
Task-number: QTBUG-142
Change-Id: I4a68da595b7c8869188225958eaa88f789d4c3bf
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-12-20 23:33:07 +01:00
Marcel Krems
106316198d Enable QSqlError to handle alphanumeric error codes.
Some database systems (like PostgreSQL) use alphanumeric error codes.
Introduce a new method nativeErrorCode() which replaces number().
If the error code cannot be converted to int, number() will return 0.

Task-number: QTBUG-142
Change-Id: Ic7fba841737674b75c0c01c2263f51d2041da497
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-12-20 16:27:41 +01:00
Marcel Krems
a14f26234b Move QSqlError private members into a pimpl class.
This allows us to add new members without breaking BC.

Change-Id: I59236cd5eeacdcfc490849a18b3bdf70d7a501bf
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-12-20 10:46:12 +01:00
Israel Lins Albuquerque
5193c14536 fix parsing of bound SQL statements for PostgreSQL
PostgreSQL allows bound variables inside square braces.

Task-number: QTBUG-34541

Change-Id: I4f069b3f1078d4cdf172fbac9e0d7d23d20d167a
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-12-16 15:35:30 +01:00
Frederik Gladhorn
f6dbdd9c16 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/sql/drivers/sqlite/qsql_sqlite.cpp

Change-Id: Ia7cffd2c99ae3d5eea6b5740683c06e921336dcd
2013-12-05 18:52:38 +01:00
Nico Vertriest
d78c39ed12 Doc: invalid reference to Qt for Linux/X11
Task-number: QTBUG-34749

Change-Id: I8274e41bc4c29650b22bb6ca5da264687aa70e4a
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2013-12-03 11:16:24 +01:00
Tobias Koenig
a774aa69db Clear isOpenError flag on successful open call
Clear the isOpenError flag in IBase driver if the QIBaseDriver::open()
call was successful, otherwise a previous, unsuccessful open() call would
block any further QSqlQuery::exec() calls on this database connection.

Task-number: QTBUG-13435
Change-Id: Idc64e28cd63805a13f208702ec87dc1bf6b98798
[ChangeLog][QtSql][QIBASE] Fixed the internal state of IBase driver after a failed open call
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-12-02 20:26:16 +01:00
Mark Brand
7bf519ec62 add mising tag to method documentation
Change-Id: Iafd7a268bf3b3be9a06ab1badc23e3db52df9586
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-12-01 23:14:34 +01:00
Tasuku Suzuki
c3c424b384 QSqlQuery::isNull string overload
Introduce isNull overload to take field name as a parameter.

This is corresponding to the commit
7e6e141234

Change-Id: I122f79707d26eaa09c2f38dc31aeee1dac7de33b
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-12-01 23:14:15 +01:00
Tobias Koenig
6a6f1e3c7e Support custom port number in IBASE SQL driver
Let the IBASE SQL driver use the custom port number
that is set via QSqlDatabase::setPort().

Task-number: QTBUG-33345
Change-Id: Ib55b32c8a318d82038d66e8645b416e36dad3edf
[ChangeLog][QtSql][QIBASE] Support custom port number
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-12-01 14:47:10 +01:00
Tobias Koenig
1c47627aa0 Fix compilation of OCI driver
Add missing feature enum in switch statement to
avoid warning that would lead to compilation error
when compiled with -Wall.

Task-number: QTBUG-34794
Change-Id: Ia2f70f27ecbb7a7dfc9d36d261103ff49b6c5e4b
[ChangeLog][QtSql][QOCI] Fix compilation
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-12-01 14:47:03 +01:00
Tobias Koenig
4f28464ab7 Fix evaluation of SQLite driver options
Ensure that the options, which are passed to the SQLite driver, are
evaluated in the correct order and do not overwrite each other.
According to http://www.sqlite.org/c3ref/open.html the
SQLITE_OPEN_READONLY and (SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) are
mutual exclusive, but SQLITE_OPEN_URI can be combined with both of them.

Task-number: QTBUG-35186
[ChangeLog][QtSql][QSQLITE] Fixed evaluation of driver options
Change-Id: I8e74fe1ce43b9118b15f7b13fc71670bdcd73f68
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-12-01 14:46:56 +01:00
Frederik Gladhorn
ded6a7081b Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-12-01 00:53:53 +01:00
Nicolas Cornu
9de879c8a4 Allow temporary databases in sqlite driver
http://www3.sqlite.org/inmemorydb.html#temp_db
[ChangeLog][QtSql][QSQLITE] Enable creating temporary databases

Change-Id: I9972fba5c91eca55cfc5a84f94cff03d19992324
Reviewed-by: Tobias Koenig <tobias.koenig.qnx@kdab.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-11-30 20:26:21 +01:00
Frederik Gladhorn
777cdb00e7 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: Ibb342cc5fc55ff9a3f4b3ecbd53936b57bc13e63
2013-11-29 15:59:34 +01:00
Tobias Koenig
9e64fc9e1c Fix sub-second handling in SQLite driver
Use explicit format string, that contains milliseconds, when
converting an QDateTime/QTime to a SQLite field content.

Task-number: QTBUG-24200
[ChangeLog][QtSql][QSQLITE] Fix sub-second handling
Change-Id: Ib89152b7c3dd780b57a8826beff8b6b118e9d3d6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-11-28 00:21:56 +01:00
Tobias Koenig
7216387370 Fix sub-second handling in MySQL driver
As stated in http://dev.mysql.com/doc/refman/5.7/en/c-api-prepared-statement-data-structures.html
the content of MYSQL_TIME.second_part field is supposed to be
in microseconds not milliseconds.

Task-number: QTBUG-31124
[ChangeLog][QtSql][QMYSQL] Fix sub-second handling
Change-Id: I5718868029bdedab9508213e800d2dcf3da9be9a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-11-28 00:21:56 +01:00
Frederik Gladhorn
4a8273a6fc Merge remote-tracking branch 'origin/stable' into dev
For the conflicts in msvc_nmake.cpp the ifdefs are extended since we
need to support windows phone in the target branch while it is not there
in the current stable branch (as of Qt 5.2).

Conflicts:
	configure
	qmake/generators/win32/msvc_nmake.cpp
	src/3rdparty/angle/src/libEGL/Surface.cpp
	src/angle/src/common/common.pri
	src/corelib/global/qglobal.h
	src/corelib/io/qstandardpaths.cpp
	src/plugins/platforms/qnx/qqnxintegration.cpp
	src/plugins/platforms/qnx/qqnxscreeneventhandler.h
	src/plugins/platforms/xcb/qglxintegration.h
	src/widgets/kernel/win.pri
	tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
	tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
	tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
	tools/configure/configureapp.cpp

Change-Id: I00b579eefebaf61d26ab9b00046d2b5bd5958812
2013-11-26 22:35:48 +01:00
Jerome Pasion
5c389cecd0 Doc: Updated url variable in qdocconf files.
In 5.2, the HTML output is in a flatter structure and when they are
hosted in qt-project.org/doc, the documentation will be found at
http://qt-project.org/doc/qt-$QT_VER

The url variable is used by projects outside of Qt 5 which need
to link to Qt 5 documentation, such as Qt Creator.

Task-number: QTBUG-34584
Change-Id: Ifa55fcd9e402b0e184a41e316340e46aeb7101de
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
2013-11-06 11:31:39 +01:00
Sze Howe Koh
16198d963d Doc: Fix broken links
Task-number: QTBUG-33360

Change-Id: Ic944cb2f575c35ebad64852ef5fc44a50ac03571
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2013-11-05 00:29:01 +01:00
Tobias Koenig
1f6dfa7749 Add QSQLITE_OPEN_URI database connection flag
This flag enables the URI mode for database names in the SQLite
backend. Without this flag, it's not possible to use URIs like
    'file:somedb?mode=memory&cache=shared'
to create shared, in-memory databases.

Change-Id: I2938184dad1f27c7af454385ca305bd4f6ed1a5e
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-11-04 09:52:36 +01:00
Sze Howe Koh
0d7d5ff5d0 Doc: Fix miscellaneous typos
Change-Id: Iaf0dd8974c3ad78beffa995c596a76fb3e4cceab
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
2013-10-30 00:34:34 +01:00
Cristian Tarsoaga
1d03918454 Fix - psql driver must format qdatetime using iso
QDateTime must be formatted as ISO8601 specifies, date/month must pe padded with 0 until width is 2
Task-number:QTBUG-33389

Change-Id: If07bcaa976ea3583369da3fd21ce442ee30e8c1f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-10-26 01:43:41 +02:00
Tasuku Suzuki
109bf980b3 Fix a bug in QSqlQuery::isNull documentation
the method returns true if there is not such field.

Change-Id: I25db8de4561d3e0604f3e64edc1810140ba4aad2
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-10-22 17:05:47 +02:00
Jerome Pasion
4533cc9944 Doc: Adding mark-up to boolean default values.
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>
2013-10-08 00:46:27 +02:00
Thiago Macieira
08f685e865 Add two enums that weren't handled in the ibase SQL driver
qsql_ibase.cpp:1155:23: error: enumeration value ‘LowPrecisionDouble’ not handled in switch [-Werror=switch]
qsql_ibase.cpp:1419:12: error: enumeration value ‘CancelQuery’ not handled in switch [-Werror=switch]

Change-Id: I3c6102051cde80c81948f5a64f9addcf7a371136
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-10-03 15:43:02 +02:00
Sergio Ahumada
a5d34b34fb Merge branch 'stable' into dev
Change-Id: I37d85631ab1165ab91457d8880c4da907a9df73b
2013-09-21 17:33:15 +02:00
Giuseppe D'Angelo
3ec52de5e9 Fix QSqlDriver::handle casting examples
QVariant::typeName() returns a const char *, so one can't use ==
to compare it against another string.

Change-Id: Id7a4c06a9e4874459609b3749f87d39ed73e8405
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-09-17 01:01:46 +02:00
Frederik Gladhorn
190fa97c83 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	examples/widgets/doc/src/addressbook-fr.qdoc

Change-Id: Id1196e8e0c6445f1616c3f29234c974d809f8e48
2013-08-27 22:51:09 +02:00
Thiago Macieira
1411a6f1ac Remove use of QFlag in the SQL drivers
It's not clear why they were added, but they aren't needed anymore.

Change-Id: I1d919deefdbd6a71fa255eeac1a8543c33ba390d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-08-24 17:41:38 +02:00
Mitch Curtis
9d0b190f4b Construct a valid QTime when creating timestamps for iBase SQL driver.
0e62fc73c9 requires this.

Task-number: QTBUG-29261

Change-Id: Idd8b630c72d0fd1c255695a8c2c22f9fe32767ee
Reviewed-by: John Layt <jlayt@kde.org>
2013-08-21 16:39:55 +02:00
Jerome Pasion
0a796cfddf Doc: Setting module pages' \qtvariable.
Argument to \qtvariable is the QT variable needed for linking to the
module.

Task-number: QTBUG-32172
Change-Id: I181c0cfaf9529f3aea741cdaee0f20d6cd0e2d2f
Reviewed-by: Martin Smith <martin.smith@digia.com>
2013-08-02 13:35:45 +02:00
Sergio Ahumada
3ef6cf060e Merge branch 'stable' into dev
Conflicts:
	qmake/generators/mac/pbuilder_pbx.cpp
	src/corelib/json/qjsonwriter.cpp
	src/corelib/kernel/qeventdispatcher_blackberry.cpp
	src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm

Change-Id: I24df576c4cbd18fa51b03122f71e32bb83b9028f
2013-07-11 16:42:01 +02:00
Mark Brand
96a22ed926 fix off-by-one index check
Change-Id: I6d6461eec24895e9aa0e77deccd39210958b7e2c
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-07-01 21:22:33 +02:00
Thiago Macieira
5dfeb9d687 Fix comma warning found by ICC
qsql_psql_p.h(122): warning #271: trailing comma is nonstandard

Change-Id: I35e12b2ae0201b8a9905d3505697a9b36a1a79e2
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-07-01 11:07:14 +02:00
Jerome Pasion
200cad26f2 Doc: Adding navigation configs in the module qdocconf files.
-The navigation bar requires the titles of the landing page and
 relevant pages.

Change-Id: I5d5986b2bf74205cd49957b63fd6ac4e32cbb36b
Reviewed-by: Martin Smith <martin.smith@digia.com>
2013-06-25 14:02:57 +02:00
Matt Fischer
d37dc75116 Improve support for <MODULE>_PATH options
Several modules, including DBus, MySQL, and OpenSSL have
configure options of the form <MODULE>_PATH, which is used
on Windows (where pkg-config is not present) to specify the
locations of third-party libraries.  These switches had been
implemented by adding extra variables which were referenced
in .pro files, to add the appropriate compiler and linker
switches.  This is undesirable because it means there are
two independent paths for adding the switches to the build,
which can get out of sync with each other, and indeed this
had happened for some of the DBus tools.

To remedy the situation, all three of the switches were
reworked so that they added values directly to the principal
variables that are used in the project files.  This reduces
maintenance, by ensuring that the pkg-config and non-pkg-config
paths appear the same to the rest of the build system.

Change-Id: Iae342f1d14b79fbcfef9fe38aadc803ad3141799
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-05-10 19:39:53 +02:00
Jerome Pasion
d0725dce7b Doc: Removed pages from "qt-sql" group.
-"qt-sql" removed in qtdoc
-no longer needed because "Data Storage" and Qt SQL pages already serve
as the main introduction to SQL support in Qt

Change-Id: I7384ae04ab4c09ecc9d76668e4e7f836095066c1
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
2013-05-07 14:28:16 +02:00
Eskil Abrahamsen Blomfeldt
522c7ba1ac Enable bundling Qt in Android package in build system
For bundling Qt, we need two things:

1. We need to build a regular .jar file out of the Java files,
so that they can be built into the app package. Dexing the
classes first (i.e. compiling the JVM bytecode to Dalvik
bytecode) is required for loading the .jar file at run-time,
but cannot be used for building it into the app, so we need
two different paths.

2. We need to specify which extra files have to be bundled for
each module (this is primarily for plugins and imports). This
is because there is no static dependency on these files, so
it cannot be detected during deployment.

Task-number: QTBUG-30751
Change-Id: I733603ee5d1c64bd7c5b9357eb5d993b9d0298f7
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-05-01 11:24:15 +02:00
Sze Howe Koh
bf9ae9018e Doc: Give C++ class lists consistent titles
The majority format is "<Qt Module> C++ Classes" (see
http://qt-project.org/doc/qt-5.0/qtdoc/modules-cpp.html)

Also, fix a broken link (Qt Network C++ Classes)

"<Qt Module> C++ API" is perhaps the more correct format, but that's
part of a much bigger cleanup: QTBUG-30556

Change-Id: I753365e2bec8d85d9a5f686b4aa35c9eeeaf0871
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-04-29 19:01:48 +02:00
Mark Brand
af35ee291a qsql_odbc: fix SQLGetStmtAtt usage
Failure to initialize the variable can cause spurious non-zero
values.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms715438(v=vs.85).aspx

"..value can either be a SQLULEN value or a null-terminated character
string. If the value is a SQLULEN value, some drivers may only write the
lower 32-bit or 16-bit of a buffer and leave the higher-order
bit unchanged. Therefore, applications should use a buffer of SQLULEN
and initialize the value to 0 before calling this function. Also, the
BufferLength and StringLengthPtr arguments are not used."

Follow-up to 1509316a37

Change-Id: I2e92eb845a2590bea0849c52bde8902adff1b419
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-04-24 01:30:20 +02:00
Andy Shaw
97c6fd22d2 Use Q_DECLARE_PRIVATE for Oracle and DB2 plugins
This completes the change started with
0bdc86d9ef by providing the implementation
for the Oracle and DB2 sqldrivers

Change-Id: Ia14415c6d7dea51f1369a81236f79aff892b3af7
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-04-09 10:21:26 +02:00
Mark Brand
f6011ec528 QSQLITE2Driver: use Q_DECLARE_PUBLIC/Q_DECLARE_PRIVATE
Follow-up to 0bdc86d9ef

Change-Id: I0a480b5780eb22b1c22e8a47b3a13ab1cd97b934
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-04-08 14:31:41 +02:00
Mark Brand
c8c8093561 QTDSDriver: fix index out of range
Follow-up to 5544208e2.

Change-Id: Iba3ff291622533e8050ddc0494e4488233727ebe
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-04-04 13:13:43 +02:00
Mark Brand
0bdc86d9ef QSqlDriver: use Q_DECLARE_PUBLIC/Q_DECLARE_PRIVATE
406c8ef6e6 introduced deriving the private SQL driver classes from
QSqlDriverPrivate. However, the drivers continued to keep their own
pointer to the private class, even though QObject provides the same
pointer. Worse yet, the private class is allocated too late and not
even passed to QSqlDriver. The result is that QSqlDriver allocates
a separate instance of QSqlDriverPrivate. This is likely to cause
all kinds of chaos.

The private class needs to be allocated in time pass it to QSqlDriver
which passes it on to QObject.

This commit covers the the base class and drivers:
    ibase
    mysql
    odbc
    psql
    sqlite
    tds

Fixes for the remaining drivers will follow.

Change-Id: Id8e7ec4205b0ca6cd00bd022c9cd24f137089245
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-04-04 13:13:37 +02:00
Mark Brand
708d39fa31 QSqlDriverPrivate clean-up
Change-Id: Ia6cbb37330bc0beed7498e43cd18bb2a1afb8e3d
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-04-04 13:13:30 +02:00
Andy Shaw
406c8ef6e6 Move the dbmstype to QSqlDriverPrivate so it can be used for all drivers
By moving it to QSqlDriverPrivate we make it easier to check what
database is actually connected which is particularly useful for the
autotests.

Change-Id: I54d1c2c998919c1d54efb1b6ac9303070ece54aa
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-04-02 19:02:26 +02:00
Mark Brand
8dfe1385b5 QSqlTableModel: expose methods for getting primary values
These methods are very useful in subclasses.

Change-Id: Ifdfee9d90cbdad97f349e46b587582f1d9e7cd7a
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-04-02 14:31:59 +02:00
Mark Brand
4131bfb2c2 make QSqlResultPrivate::fieldSerial() virtual
The Qt psql driver has its own implementation of fieldSerial() it uses
when it invokes positionalToNamedBinding() to generate a query using
its native naming style. Now that QPSQLResultPrivate is derived from
QSqlResultPrivate this can be implemented more conventionally using
a virtual function instead of pointers to static functions.

Note that this change preserves the current behavior of
executedQuery() which will continue to return the query with
positional syntax that is presented to virtual prepare() by
QSqlResult::savePrepare(). Since the driver does not have the
NamedPlaceholders feature, QSqlResult::savePrepare() will not use
positionaltoNamedBinding() to set executedQuery. Although
QPSQLResult::prepare() calls positionaltoNamedBinding(),
it does not put the result into executedQuery.

Change-Id: I7740f386cbfec9eadd9e4d6a7df3e590294655a5
Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-04-02 14:31:47 +02:00
Mark Brand
db6190d6fe QPSQLResultPrivate inherit QSqlResultPrivate
Follow the usual pattern that a subclass's private class inherits
its base classes's private class. This will allow the private class
to use virtual functions.

Change-Id: Iafdf1cb5db672d973ad1f60bdd7e37b9072fbb1b
Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-04-02 14:31:44 +02:00
Mark Brand
7565f6fe0a QPSQLResultPrivate: do not duplicate reference to private driver
The "private driver" is already known, so don't keep an extra reference
to it.

Change-Id: I34ec4108694bfbc3da3107f79598ae50a699911c
Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-04-02 14:31:40 +02:00
Israel Lins
f9d856b3f5 ODBC: lost info about column metadata on SQL_NO_DATA
In reset() if SqlExecDirect returns SQL_NO_DATA the column metadata
is ignored.

Change-Id: I0501fa47c42754bba42b3531da59e66c696eac53
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-03-20 23:30:43 +01:00
Sergio Ahumada
e5a11fbb32 Merge "Merge branch 'dev' into stable" into refs/staging/stable 2013-03-20 23:30:31 +01:00
Israel Lins
0646d1131b ODBC: fixed consistence of return of QODBCResult::exec()
The QODBCResult::exec() returns false when query is an delete
with no data do delete caused by SQLExecute function returning
SQL_NO_DATA, but the false return means error on execution.

Task-number:  QTBUG-10569
Change-Id: I6c7ebadcf62ab404b60c7bcccdab6a10bf16a923
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-03-20 23:30:23 +01:00
Oswald Buddenhagen
76c0be34cd Merge branch 'dev' into stable
This starts Qt 5.1 release cycle

Conflicts:
	src/gui/text/qfontdatabase.cpp
	src/gui/text/qharfbuzz_copy_p.h
	src/widgets/kernel/qapplication.cpp
	src/widgets/kernel/qcoreapplication.cpp

Change-Id: I72fbf83ab3c2206aeea1b089428b0fc2a89bd62b
2013-03-20 13:49:28 +01:00
Thiago Macieira
d1b4857d17 Make sure that we #include qconfig.h before testing for features.
This is mandatory in public headers (qiodevice.h, qopengl*, etc.), but
it's a good idea even in private headers, in case someone includes
that header first somewhere. In particular, all platformsupport API is
private.

Change-Id: If287baa5d9ed14e93c1666efa0e6332c4c1cd9a4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-03-19 07:02:57 +01:00
Axel Waggershauser
b11317a643 Whitespace cleanup: remove trailing whitespace
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>
2013-03-16 20:22:50 +01:00
Mark Brand
e3c5351d06 postgresql driver: escape backslashes only when server requires it
Task-number: QTBUG-30076

Change-Id: I408cda941884f01484d0edfa82c91fc19cb8718c
Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br>
Reviewed-by: Sergey Blagodarin
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Andras Mantia <andras@kdab.com>
2013-03-13 17:28:07 +01:00
Israel Lins
36b6d4afc9 ODBC: fix loss of milliseconds when binding QDateTime
Caused by operator precedence error.

Follow-up to commit b8b79a0f37

Task-number: QTBUG-2192
Change-Id: I17decd18c469b48a0bc938ae05c16cced8042219
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-03-13 17:27:57 +01:00
Marko Kangas
18be0749eb Fix for Sql query aliases with dots
Task-number: QTBUG-14904

Change-Id: I98a02d4bbf28522cd5c2f65ea606b6b26977e8e6
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-03-13 17:27:36 +01:00
Mark Brand
53de293433 QSqlResult: private d -> protected d_ptr
This QObject-style convention will allow the usual private class
macros to be used.

Change-Id: I992ee2a2d2e7984d57feb4cbe785a267f2fd83ce
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-03-06 00:11:11 +01:00
Mark Brand
2adeefc85f add QSqlResult constructor suitable for inheritance
The new constructor accepts reference to the private
class provided by a subclass.

Change-Id: I568e31727bb90de12ee8bb7bf0ed442737056470
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-03-06 00:11:08 +01:00
Mark Brand
fd6821aa19 QSqlResultPrivate: private q -> protected q_ptr
This QObject-style convention will allow the usual private class
macros to be used.

Change-Id: Ib1cee0b3aca949b75511868ad4914e5b8530929b
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-03-06 00:11:06 +01:00
Mark Brand
8434b7ad4a prepare QSqlResultPrivate() to allow subclassing
Allow the private class to be instantiated before the public class.
Public subclasses will need to first instantiate the private subclass
and pass the reference to QSqlResult.

Add virtual constructor so QSqlResult can delete private class
polymorphically.

Change-Id: Ide7115dbb4150d6604677b542dbec16e6956a142
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-03-06 00:11:03 +01:00
Tor Arne Vestbø
d28073d9eb Distinguish between 'mac' and 'macx' qmake scopes
The former applies both on Mac OS X and iOS, but 'macx' is specific to
Mac OS X.

ios.conf and macx.conf now share most of their settings in the common
mac.conf. We set the default QMAKE_MAC_SDK before loading mac.conf, so
that any overrides in the device config will apply afterwards. This
means configure's mkspec parsing will be able to read the QMAKE_MAC_SDK.

Change-Id: I0c7e26a6a0103e19b23ef152aa9e4ab461cee632
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-03-05 20:59:45 +01:00
Israel Lins
f4d7b4d10f PSQL: lastInsertId without OID on table
Make lastInsertID work for tables without OIDs.
The use of OID in tables is now deprecated in PostgeSQL and
lastval() is now provided.

http://www.postgresql.org/docs/8.1/interactive/runtime-config-compatible.html#GUC-DEFAULT-WITH-OIDS

Change-Id: I01dfdd7a2aab8826487657f691fea3c9268c16b2
Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-28 10:04:46 +01:00
Israel Lins
70bb34ccd5 ODBC: implementation of lastInsertId()
Implemented lastInsertId() for some ODBC compatible databases.

Change-Id: I0b75a8e68369af39e258e4761b384767ab8a371e
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-27 22:01:17 +01:00
Israel Lins
bc5170f274 ODBC: improve detection of DBMS
Change-Id: Ia93c3adb54fd28e290ff6fc85cb98138514885f1
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-26 22:01:27 +01:00
Mark Brand
4da840f230 make static function a class member
Change-Id: I8c18c746185f6b7530ed985f4d482a1c9073fb10
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-02-26 19:48:22 +01:00
Mark Brand
63b180d390 rename private driver to privDriver
This avoids confusion now with the actual driver and avoids a
name collision in later refactoring.

Change-Id: I83055213f3a7b7998640662d49ba33749fdadd18
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-02-26 19:48:18 +01:00
Mark Brand
ad211acae4 qpsql: simplify expression
Change-Id: I1cff816ca5e8f683015186a2b5815e564ad454e6
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2013-02-26 19:48:12 +01:00
Thiago Macieira
932c50c015 Adapt the newly-renamed SQL driver headers to proper private headers
Add the "We mean it" text and remove the now-unnecessary syncqt macros
that used to prevent those headers from being added to the master
includes.

Change-Id: I03ac2a452bc6ac43ebba502bc0ecbf5ee1adf314
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-26 11:20:11 +01:00
Thiago Macieira
1ee1147462 Rename the SQL driver header files to _p.h (make private)
The drivers were never public API. They were exposed by mistake in
public headers. What's more, they have #include'd a private header
(qsqlcachedresult_p.h) since at least Qt 4.5.1. That means no one used
those headers in Qt 4 (private headers weren't installed then) and
it's unlikely anyone did in 5.0.

Change-Id: Ie0a47bcf0260ee6bdd3d8494b78fd1eec28a2d6b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-26 11:20:06 +01:00
Marcel Krems
7ea6ac832e Deprecate QSqlError setters.
The constructor is sufficient, since it has a parameter for each member variable.
Even the drivers, which were mentioned in the class description don't use them.

Change-Id: Ie8ba0467c7dc1928c539b4b19db8cc2ea0f44ea0
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-24 17:10:18 +01:00
Frederik Gladhorn
f4900d340a Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/widgets/styles/qmacstyle_mac.mm

Change-Id: If8326db9e7da3cbf45dbf7475fdff9915c7723b1
2013-02-18 16:14:52 +01:00
Israel Lins
776c488b6f QSqlResult: fix parsing of bound SQL statements
Parsing for bound SQL parameters now handles identifier quoting using
double quotes (") and square brackets ([]).

The following has only 1 bound value but previously 2 were detected:
SELECT 1 AS "A?b[?']]]de?ghi", ?

Task-number: QTBUG-27159
Change-Id: Icfd02187e1126ff3b5ed11df8d4e599f574e61bf
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-15 15:47:58 +01:00
Karim Pinter
c8e34ed678 Fix DB2 driver X64 Linux Build
On X64 Linux DB2 driver build give an error on BIGINT conversion to
QVariant, casting it to qint64 solved the problem.

Task-number: QTBUG-20172
Change-Id: I7ef31cbe643c90b40b86cf3d7c4d3b711eabf2f5
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-15 15:46:57 +01:00
Mark Brand
2fc5edffa4 qpsql: reuse QSqlResultPrivate::positionalToNamedBinding
reuse QSqlResultPrivate::positionalToNamedBinding for psql

Change-Id: I48713c3f94eb880cafff5fddbeadaa0746a405a9
Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2013-02-15 12:17:17 +01:00