QT5 usually builds with a MySQL driver that connect to a server. The documentation also provides information on how to achieve an embedded connection however, there is no much information on how to have a Qt application using both the embedded and server connection. The example below show how to achieve it:

MySQL Dual Connection (Embedded / Server) with QT5