Commit Graph

908 Commits (724716ea335605dc1f9287c7cd9f88c709f6993c)

Author SHA1 Message Date
Ahmad Samir 209593aeba QtSql: fix GCC -Wextra-semi warnings after member function definitions
Change-Id: I5b65f543d7a36386181e493d8b9ce0267132d686
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 291c762802a2f5e1edb6bd9a842663ca5689323a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 149150ab47eb4e5924158e8e47aa71f3d6300c79)
2024-12-20 10:40:03 +00:00
Botond István Horváth 3210c4c691 QSqlTableModel: remove a call to `cache.empty()`
The call to the const `empty()` didn't do anything, because its results
were unused. Since this code has not been touched for some ~13 years,
just drop the call. (Probably clear() was intended, however doing that
change makes the corresponding autotest fail.)

Aggressively cherry-picking because I want to also cherry pick
[[nodiscard]] on empty() (which would've found this bug N years ago.)

Change-Id: I801d0c364a7122bb26d407c23ae99278939c50ff
Pick-to: 6.5
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 95c55d6f3216bfeb6d802fb70e455849b8c3567f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-12-05 19:26:43 +00:00
Christian Ehrlicher 0f80bb1811 SQL/Doc: add notes about QDateTime handling
Add a note on how timestamps are handled for the different database
drivers.

Task-number: QTBUG-130118
Change-Id: I1bad480fa18b5b719870635db1444c8db8c7d966
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit d63f14473345cdb83c2da00a19892f57e661a5d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-13 23:56:26 +00:00
Marc Mutz b8c9a4c3d1 Create qdoc macros for C++ class docs 1.3: member-swap(), non-standard phrasing
We have some patterns for how to document certain functions, but we
also vary the sentences a lot, and you have to look up one
documentation piece and copy it, essentially. If we ever want to
change them, we end up with shotgun surgery.

So apply DRY to the documentation and start a collection of macros to
help with repetitive C++ class documentation tasks.

The first macro is for member-swap(), and this third patch is for
documentation that used a non-standard phrasing for documenting
member-swap(). By using the macro, the documentation automatically
conforms to what the documentation team picks as the \memberswap
expansion going forward.

As a drive-by, fix doc block indentation to the Qt standard of 4
spaces (only in changed lines), and add a few blank lines where they
were missing before.

Fixes: QTBUG-129573
Pick-to: 6.7 6.5 6.2
Change-Id: If007602d7690572fcbb848a8d0235416c908cfd2
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 82058367923ce164024885854c139ee5e0d89949)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-12 13:09:02 +00:00
Marc Mutz e1f46ee8ae Create qdoc macros for C++ class docs 1.2: member-swap(), simplified phrasing
We have some patterns for how to document certain functions, but we
also vary the sentences a lot, and you have to look up one
documentation piece and copy it, essentially. If we ever want to
change them, we end up with shotgun surgery.

So apply DRY to the documentation and start a collection of macros to
help with repetitive C++ class documentation tasks.

The first macro is for member-swap(), and this second patch is for
documentation that used the simplified phrasing ("Swaps this X with \a
other."), which this patch adopts as the text for \memberswap, too,
because it doesn't repeat the macro argument, making it easier to find a
grammatically-fitting argument than in the traditional phrasing.

This doesn't change the documentation, except as follows:

* standardizes on simpified instead of traditional phrasing for docs
  that already use the \memberswap macro
* adds the "very fast and never fails" blurb, if it was missing
* changes the function's argument name to `other`, as required by
  the macro.

Task-number: QTBUG-129573
Pick-to: 6.7 6.5 6.2
Change-Id: I1123e783ce0da76c5997ff74007d77504ac5b334
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 5627e113793df3df24742d7af502a075c2c9e95d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-12 13:09:02 +00:00
Marc Mutz 285bfffc63 Create qdoc macros for C++ class docs 1.1: member-swap(), traditional phrasing
We have some patterns for how to document certain functions, but we
also vary the sentences a lot, and you have to look up one
documentation piece and copy it, essentially. If we ever want to
change them, we end up with shotgun surgery.

So apply DRY to the documentation and start a collection of macros to
help with repetitive C++ class documentation tasks.

The first macro is for member-swap(), and the first patch is for
documentation that used the traditional phrasing ("Swaps the X \a
other with this X.").

This doesn't change the documentation, except as follows:

* adds the "very fast and never fails" blurb, if it was missing
* changes the function's argument name to `other`, as required by
  the macro.

Task-number: QTBUG-129573
Pick-to: 6.7 6.5 6.2
Change-Id: Ib494bd218334724b3b43796ba6f71fb52b83aa94
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 3ccb4ce781463f1b8e0cb4c9283b3067fe92a32e)
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-11-12 13:09:01 +00:00
Christian Ehrlicher 05c0ce01fb QSqlRelationalTableModel: properly clear relational dictionary
When the relationModel is updated (e.g. a new row is added or removed),
the internal relation cache needs a refresh to reflect those changes.

Fixes: QTBUG-128434
Change-Id: Ie388c01d545564ad7b1424d70267166ac1e4bfd6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 48753a03de7c9c394fbf4cf69e2c2f3d1048c85f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-08 10:08:26 +00:00
Christian Ehrlicher da87068f7f SQL/Doc: improve documentation on building and debugging a sql driver
Add some notes on the prerequisites when building a sql driver from
source and also add some more notes in the troubleshooting section.

Pick-to: 6.7 6.5
Change-Id: I8ffbcf4182c2ad2c7b9f86209e0ce332fd27d73c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1f31c5f3cd722f06e4f41457ec1322365d78c018)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-02 15:18:44 +00:00
Christian Ehrlicher 5ebab802cc SQL/Interbase: Add and document Interbase_ROOT
Instead specifying Interbase_INCLUDE_DIR and Interbase_LIBRARY allow to
use Interbase_ROOT instead. Use this new option in the sql driver
documentation.
Additionally add 'fbclient_ms' as possible library name so we don't need
to distinguish between Interbase and Firebird anymore.

Change-Id: I472f95f82ebb93888002deccdf5028a1827a4745
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 89dd15e359228a57351bddc2429db4d57863bc8f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-31 08:56:17 +00:00
Christian Ehrlicher 517d11d0c5 SQL/PostgreSQL: use PostgreSQL_ROOT in documentation
Instead specifying CMAKE_INCLUDE_PATH/CMAKE_LIBRARY_PATH use
PostgreSQL_ROOT which is suits much better for the usecase.

Change-Id: Iac239d88d4c9c11d5482acacb2bbb1bb034c4365
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit a664a6e225abdd4a62aac57df10e3507fcd2b561)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:48 +00:00
Christian Ehrlicher 60590c1a2b SQL/Oracle: use Oracle_ROOT in documentation
Instead specifying Oracle_INCLUDE_DIR/ORACLE_LIBRARY use Oracle_ROOT
which is suits much better for the usecase.

Change-Id: I8a0858b3ae491212a79ad982eb8e067e6f1b750f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit 5e478ebbcc42471b4c70c10bb513e7343c05933e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:42 +00:00
Christian Ehrlicher 20429da06a SQL/MySQL: use MySQL_ROOT in documentation
Instead specifying CMAKE_INCLUDE_PATH/CMAKE_LIBRARY_PATH use
MySQL_ROOT which is suits much better for the usecase.

Change-Id: Ieb75f80a6eb3a3e7913a7c04ca6511a014fa7e4e
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 0c0b5cbb0d0b43f6be4e54caea89d5764511e94f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:32 +00:00
Paul Wicking 4cef74fe76 Doc: Remove usage of defunct QDoc command
The QDoc command `\tableofcontents` was rendered useless by a change
more than a decade ago. Remove the use of `\tableofcontents` as it
serves no purpose, and ensure that the surrounding context still makes
sense for the reader, by removing preceding text that refers to a
non-existing table of contents, such as `Contents:`.

Task-number: QTBUG-128173
Change-Id: Ibb5a6af0e80f70fa487cdf6a7e38009a9ef60cbf
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit cd8244131e2d6fe2c2453ae40213e7f12bff893d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 11:39:51 +00:00
Christian Ehrlicher c211b1dbbe SQL/Doc: remove paragraph about CMAKE_INCLUDE/LIBRARY_PATH
Using CMAKE_INCLUDE_PATH/CMAKE_LIBRARY_PATH to find the correct database
includes and libraries does work but is nothing which should be
documented here - it's a common way to specify common paths for cmake.
Documenting this here just confuses the user (which already has hard
times to compile the plugins by itself).

Change-Id: I0cb051f06f3c71f005290700e3b6c32da9a0b2b5
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e279dd8c20794810292047c8c84f309e8aed004b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-26 04:18:31 +00:00
Christian Ehrlicher f9d6c8b14c QSqlDriver/doc: Add a note about features depending on the db server
Some features are server-dependent and therefore an open db connection
is needed to make sure that the feature is available.

Pick-to: 6.7 6.5
Fixes: QTBUG-10016
Change-Id: Ia9a117a64ba5fe7cdd69bf95a41cfc301ab5fd94
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 139b8779469244dd1aa226dd3222e6e4aeb2c932)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 21:00:12 +00:00
Christian Ehrlicher 4ab6fc7215 SQL/QSqlRelationTableModel: don't crash with more than one relation
When more than one relation is used, an internal container might be
resized which can lead to a reallocation. Since the internal data
structure holds a pointer to an element of this container, this pointer
is invalidated after the reallocation. Therefore store a QSharedPointer
instead.

Pick-to: 6.7 6.5
Fixes: QTBUG-60674
Change-Id: I18c6157c7328be201f8b89a7ca12f423a86d9b71
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c0aabbd8a0c5a01c2048bcaf36525570a8e0bb35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 21:00:12 +00:00
Alexey Edelev 10b48d59dd Remove GENERATE_CPP_EXPORTS argument
The behavior that argument was enabling is the default one now.

Task-number: QTBUG-90492
Change-Id: I11711d4c794f0b22169abb595b8ffad2eeb1300d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 1ef3bd05eb45d53cdcf92b933603b995283b3432)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 14:39:17 +00:00
Christian Ehrlicher 371113810e SQL/QSqlField: move deprecated functions decls to correct place
Don't move them around during deprecation.

Change-Id: I647fec5a440ea063463dc285def5d793726a9e61
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 70475a652a9a44651c25126f6615770e8b43ca1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 14:18:27 +00:00
Christian Ehrlicher b34fa2f61f SQL: Code cleanup - move Q_PROPERTY to the correct place
... which is directly after Q_OBJECT/Q_GADGET

Change-Id: I3fb2b2e810a68e0ae811e55b286bc5f40364295f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 031eabe845c41ef98cb078d0fae0521156a75b9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 06:26:15 +00:00
Christian Ehrlicher c8d8cfa333 SQL/Doc: add note about QAnyStringView
Add a note to all functions now taking a QAnyStringView that their
signature changed from QString to QAnyStringView

Change-Id: Ib9743b5b2c437724c6308e74ef3c5820136a34f5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a736a3c670929e3b73e11b33cc1705957c42961b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-13 06:26:15 +00:00
Christian Ehrlicher 4735382122 QSqlRecord/QSqlQuery: Use QAnyStringView instead QStringView
Change all functions taking a QStringView to take a QAnyStringView and
remove all functions taking a const QStringRef since this can now be
fully handled by the QAnyStringView ones.

This amends f2dba19194 and
993f318014

[ChangeLog][QtSql][QSqlRecord] All functions taking a QString were
changed to take a QAnyStringView.

Change-Id: Ia1c968c4e2a7a93aa26d090ef6605271305c14a6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6b096271cf0aac38d80f292f8b37edd671a8d17f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-05 04:17:33 +00:00
Christian Ehrlicher 102670a82e SQL/QSqlRecord: rework QRecord::indexOf(QStringView)
Move it to the private implementation to be later used as a template
when switching to QAnyStringView.

Change-Id: If9977711757677546cfc058602ada9f54b978509
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-31 19:30:53 +02:00
Christian Ehrlicher 5a7c2cbabb QSqlDatabase: Rename currentThread() to thread()
... to be in sync with QObject naming.
This amends b4c63b89df.

Change-Id: I25301f65aa880205d8c0cfd6f4bfa9fdba34a01c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-05-31 19:30:53 +02:00
Christian Ehrlicher e337f14707 SQL/models: use qsizetype/range-base for loops where possible
Replace some 'native' for loops with range-base for loops or use
qsiztype instead int, mark some helper functions as const.

Change-Id: Ib3f368d6c07bc170ab4ed7cbf28181a226dbeac5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-23 16:52:20 +02:00
Jesus Fernandez 7c128f8866 Add -Wweak-vtables to headersclean
This requires some fixes in several classes that are also included
in this patch.

The QTestEvent hierarchy is all-inline and changes layout depending on
QT_GUI_LIB and QT_WIDGETS_LIB, so we can't just export it. Suppress the
warning in that header for now. Created QTBUG-104486 to track a fix for
the real issue.

The QFutureInterface hierarchy is also all-inline, but templates, so
doesn't trigger, except the <void> specialization. Created
QTBUG-125115 to track a fix for the real issue.

Done-with: Marc Mutz <marc.mutz@qt.io>
Task-number: QTBUG-45582
Change-Id: I96b3e109aa989b70e0d4809b90bd53a369e50d55
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-05-19 15:56:17 +00:00
Christian Ehrlicher 5a7d41667d SQL/QSqlIndex: remove unused private function createField()
This function was forgotten when the Qt3 support was removed during
initial Qt5 porting (f306d18fe6).

Pick-to: 6.7
Change-Id: I83a0be0db7e81bd9d4f84683a013e1d4faab2dd8
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-04-26 16:37:55 +01:00
Christian Ehrlicher b4c63b89df QSqlDatabase: add moveToThread()/currentThread()
Add QSqlDatabase::moveToThread() to be able to move the driver instance
to another thread.

[ChangeLog][Sql][QSqLDatabase] QSqlDatabase gained two new functions
moveToThread() and currentThread() to be able to use it in another
thread than the one it was created in.

Fixes: QTBUG-39957
Change-Id: I9cb51358f73a3a2fa72813bfdbe059279d388bd7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-04-25 08:27:21 +02:00
Vladimir Belyavsky b8d92d2ef8 SQL: avoid potential detach in QtSqlGlobals dtor
Wrap `connections` to std::as_const() to avoid unexpected detach
due to use of QHash::asKeyValueRange() in range-based for loop.

Change-Id: I2bf69782dc9dc63df0b3f9dfe395427909fba310
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-04-21 15:09:52 +00:00
Christian Ehrlicher 2cd0bc729e SQL/QSqlDatabase: use categorized logger
Use the categorized logger qt.sql.qsqldatabase

Change-Id: I25216d0809ff0316371a62913b56e1f56ab37ab4
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-18 20:11:14 +02:00
Christian Ehrlicher 6bc454b247 SQL/QSqlQuery: use categorized logger
Use the categorized logger qt.sql.qsqlquery

Change-Id: Ib5c26751ef013261080207fc13b80b91c644a640
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-18 20:11:14 +02:00
Giuseppe D'Angelo 7466831509 Long live [[nodiscard]] QFile::open
Having already caught some bugs in real code because of unchecked calls
to QFile::open, this commit marks QFile::open (and open() in other
file-I/O classes) as [[nodiscard]].

Since it's going to raise warnings, the plan is to keep the existing
behavior up to and including the next LTS. Then the warnings will switch
on by default. All of this is protected by system of macros to opt-in or
opt-out the behavioral change at any time.

A possible counter-argument for doing this is that QFile::open is also
used for opening files in the the resource system, and that opening
"cannot fail". It clearly can, if the resource is moved away or renamed;
code should at a minimum use a Q_ASSERT in debug builds. Another
counter-argument is the opening of file handles or descriptors; but
again, that opening may fail in case the handle has been closed or if
the flags are incompatible.

---

Why not marking *every* open() override? Because some are not meant to
be called directly -- for instance sockets are supposed to be open via
calls to `connectToHost` or similar.

One notable exception is QIODevice::open() itself. Although rarely
called directly by user code (which just calls open() on a specific
subclass, which likely has an override), it may be called:

1) By code that just takes a `QIODevice *` and does something with it.
   That code is arguably more rare than code using QFile directly.
   Still, being "generic" code, they have an extra responsibility when
   making sure to handle a possible opening failure.

2) By QIODevice subclasses, which are even more rare. However, they
   usually ignore the return from QIODevice::open() as it's
   unconditionally true. (QIODevice::open() doesn't use the protected
   virtual pattern.)

I'll try and tackle QIODevice in a future commit.

[ChangeLog][QtCore][QFileDevice] The open() functions of file-related
I/O classes (such as QFile, QSaveFile, QTemporaryFile) can now be marked
with the "nodiscard" attribute, in order to prevent a category of bugs
where the return value of open() is not checked and the file is then
used. In order to avoid warnings in existing code, the marking can be
opted in or out, by defining QT_USE_NODISCARD_FILE_OPEN or the
QT_NO_USE_NODISCARD_FILE_OPEN macros. By default, Qt will automatically
enable nodiscard on these functions starting from Qt 6.10.

Change-Id: Ied940e1c0a37344f5200b2c51b05cd1afcb2557d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-04-17 20:07:47 +02:00
Christian Ehrlicher 9873f4b283 SQL/ODBC: don't escape a driver string
We must not try to escape a driver string, the user has to make sure
that everything is correctly escaped when passing a complete driver
string. This fixes a regression from QTBUG-122642.

Pick-to: 6.7
Fixes: QTBUG-123444
Change-Id: I43316c7a09060f5c8117fdc3c464d239e37d9cdf
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2024-04-04 23:43:02 +02:00
Zhao Yuhang 90217f37ca QSqlField: fix missing deprecation macro
Change-Id: Ia544da629d495abdfdd0efe0e0991124a9f5d7ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-04-04 12:21:12 +00:00
Christian Ehrlicher e65dc19332 SQL/QSqlField: deprecate internal functions setSqlType()/typeID()
These functions set/get the db-specific internal sql type but it's not
used in any of the sql plugins since ages. Any external plugin using this for some reason must be ported away until Qt7.

Change-Id: Ifb33e9d3be0b80fb4d0979d31436e89ea6a8208b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-10 18:16:00 +00:00
Christian Ehrlicher e2e818483f SQL/MySQL: retrieve default column value for QSqlDatabase::record()
Retrieve the default value (if set) of a column during
QSqlDatabase::record() but not for QSqlQuery::record() as it's done for
the other drivers which support retrieving the default column value.

Fixes: QTBUG-122723
Change-Id: I92e052bfa6d88e019c0151fbcbc1483a65770c55
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-10 19:15:47 +01:00
Lucie Gérard 1556a3a5eb Correct doc snippet license
All file under doc/snippet should be
license as Documentation snippets
and according to QUIP-18 [1]
this is LicenseRef-Qt-Commercial OR BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I76eedfb6b15c4091f726a5652e3530001d7cdaf7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-28 19:15:51 +01:00
Christian Ehrlicher 3379fd2322 SQL/SQLite: handle option SQLITE_OPEN_NOFOLLOW
Since SQLite 3.31 there is a new open() option SQLITE_OPEN_NOFOLLOW to
disallow a filename with a symlink for security reason. Expose this
option to QSQLite via QSQLITE_OPEN_NOFOLLOW.

[ChangeLog][SQL][SQLite] Add new option QSQLITE_OPEN_NOFOLLOW to expose
open mode SQLITE_OPEN_NOFOLLOW.

Pick-to: 6.7
Change-Id: I2d6218bde2bf8b4f1bc36125dffa551b52369072
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-26 14:43:10 +01:00
Paul Wicking 99b9eb7177 Doc: Fix QDoc warnings for overloads
Change-Id: I9a77b6ea0026748c7f97f73b327118f7a9212d52
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2024-02-14 21:47:28 +01:00
Thiago Macieira f3832b63de QtSql: #include mocs
Pick-to: 6.7
Change-Id: I50e2158aeade4256ad1dfffd17b1f286a9001ae8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-02-10 02:39:14 -08:00
Christian Ehrlicher 74722411d3 QSqlQuery: remove unneeded friend tst_QSqlQuery
... as it is no longer needed.

Pick-to: 6.7
Change-Id: Ia60b6e53675260ef0e793ac1b44c913af1454b35
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-09 17:12:23 +01:00
Christian Ehrlicher 781135b0d2 QSqlDatabase: add Q_PROPERTY
Add Q_PROPERTY to follow the current Qt style and simplify the
documentation.

Task-number: QTBUG-120566
Change-Id: I23103a921cd391f24ce0ffd915a4ae2f98686d21
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2024-02-05 21:52:33 +01:00
Lucie Gérard 865d0133fc Change license of .qdoc files
According to QUIP-18 [1], all .qdoc files should be
LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Change-Id: I4559af21fc9069efa9bf0cbd29c5e86cfdac9082
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-02-01 19:25:42 +00:00
Christian Ehrlicher 212e88889a QSqlQuery: add Q_PROPERTY
Add Q_PROPERTY to follow the current Qt style and simplify the
documentation.

Task-number: QTBUG-120566
Change-Id: I3803f5246c1814d627a16fa2569d1342b54f6adf
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-01-24 21:35:09 +01:00
Christian Ehrlicher 294da15696 QSqlIndex: add Q_PROPERTY
Add Q_PROPERTY to follow the current Qt style and simplify the
documentation.

Task-number: QTBUG-120566
Change-Id: Iaf844eb6f60427dab7fba6ac20b16ffa11f217b8
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-01-24 20:35:09 +00:00
Christian Ehrlicher c10530fd97 SQL: remove outdated \since tags
There is no need to know if a function was added in Qt4 or earlier so
remove all \since 4.x tags.
Amends 747581e0bf

Change-Id: I470bc785b1e31685caec561dafaec0ba97208d99
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2024-01-24 21:35:09 +01:00
Christian Ehrlicher 747581e0bf SQL: remove outdated \since tags
There is no need to know if a function was added in Qt4 or earlier so
remove all \since 4.x tags

Change-Id: I5cf4e89a3e30c13fac076f1ae7abb33a625e366c
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-01-21 10:12:31 +01:00
Christian Ehrlicher 6dfc988ea0 QSqlDriver: add Q_PROPERTY
Add Q_PROPERTY to follow the current Qt style and simplify the
documentation.

Task-number: QTBUG-120566
Change-Id: Ibbafde35bb5600453ed3a3de36b6bf2b5c560e5f
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-01-19 17:29:09 +01:00
Christian Ehrlicher 9806f54a58 QSqlField: add Q_PROPERTY
Add Q_PROPERTY to follow the current Qt style and simplify the
documentation.

Task-number: QTBUG-120566
Change-Id: I593ba9f322273991661c1d14fb51dcb23678ea0f
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-01-19 17:29:06 +01:00
Christian Ehrlicher b1e5d9275d SQL: rename enablePositionalBinding() to setPositionalBindingEnabled()
... and the getter to isPositionalBindingEnabled() for QSqlQuery and
QSqlResult.
This amends e532933a2a

[ChangeLog][QtSql][QSqlQuery] Add setPositionalBindingEnabled() to be
able to disable positional binding.

Pick-to: 6.7
Task-number: QTBUG-119952
Fixes: QTBUG-120548
Change-Id: I0a0afb652d0fc9421f5692b0927a66b2a9b7b854
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2024-01-10 04:32:49 +01:00
Christian Ehrlicher f2dba19194 QSqlQuery: Add QStringView overloads
Add an overload to QSqlQuery::isNull()/::value() taking a QStringView -
those two functions can now use the newly introduced
QSqlRecord::indexOf(QStringView)

[ChangeLog][QtSql][QSqlRecord] QSqlQuery::isNull() and value() gained a
new overload taking a QStringView.

Change-Id: Icebce88b94a7413130bdd7ec0098f51726d05892
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2024-01-10 04:11:52 +01:00