After checking up. There is no way to set loose-local-infile (MYSQL_OPT_LOCAL_INFILE) in the connection.
However, one can add such an option to the QMYSQL Driver and rebuild it. This I described here: https://bugreports.qt.io/browse/QTBUG-104916 then you can set it up with setConnectOptions("MYSQL_OPT_LOCAL_INFILE=1");
Bookmarks