It looks like MySQL driver doesn't allow you to set the timeout.

See: QSqlDatabase::setConnectOptions()