As of Qt 6.8 there is a new QSqlDatabase function that supports moving QSqlDatabase instance to a different thread:
bool QSqlDatabase::moveToThread(QThread *targetThread)
Qt Doc