summaryrefslogtreecommitdiffstats
path: root/src/sql/kernel/qsqldatabase.h
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2018-12-21 14:34:28 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-12-23 11:41:36 +0000
commitf03941e4113e2c8c0a594592be44efc92614ec9d (patch)
tree158111ff8335c3923c41a86a7b64788297aab8ee /src/sql/kernel/qsqldatabase.h
parent37b30983023a2e1fd5d7250ee2d15d8574a5cc2d (diff)
Add overload of QSqlDatabase::cloneDatabase to allow cloning cross threads
Since QSqlDatabase::database() cannot be used to access another database from another thread, then the overload is provided to make it possible to clone with just the connection name. This will handle the cloning internally safely then. Fixes: QTBUG-72545 Change-Id: I861cc5aa2c38c1e3797f6f086594a1228f05bada Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/sql/kernel/qsqldatabase.h')
-rw-r--r--src/sql/kernel/qsqldatabase.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/sql/kernel/qsqldatabase.h b/src/sql/kernel/qsqldatabase.h
index 3aadab9b2f..f233c72c19 100644
--- a/src/sql/kernel/qsqldatabase.h
+++ b/src/sql/kernel/qsqldatabase.h
@@ -118,6 +118,7 @@ public:
static QSqlDatabase addDatabase(QSqlDriver* driver,
const QString& connectionName = QLatin1String(defaultConnection));
static QSqlDatabase cloneDatabase(const QSqlDatabase &other, const QString& connectionName);
+ static QSqlDatabase cloneDatabase(const QString &other, const QString& connectionName);
static QSqlDatabase database(const QString& connectionName = QLatin1String(defaultConnection),
bool open = true);
static void removeDatabase(const QString& connectionName);