--- a/src/tm/jobs.cpp
+++ b/src/tm/jobs.cpp
@@ -78,7 +78,7 @@
 
 static const QString getConnectionNameForCurrentThread(const QString &dbName)
 {
-    return getPartialConnectionName(dbName) + QString::number((long)QThread::currentThreadId());
+    return getPartialConnectionName(dbName) + QString::number((std::intptr_t)QThread::currentThreadId());
 }
 
 QSqlDatabase getDataBaseForCurrentThread(const QString &dbName)
