Can't connect to QGC via UDP connection using MAVLink messages

Hello. I have an unmanned submarine that runing on UP (Ubuntu 20.04), I don’t have PX4 or Adrupilot, but i still want to custumize the QGC for my purposes.
I write a simple code that use the adrupilotmega.xml messages and i am trying to send messages to QGC via UDP connection. I can see the mavlink messages in the mavlink inspector but the QGC still showing “Disconnected” - my goal is to connect to QGC. when I asked this quastion in other forums people told me to use MAVSDK and try to send a stream of heartbeats - it still doesn’t work. If I understand the issue correctly I think I need to change something in QGC code and make it connect even though it doesn’t recognize the device. Where do I need to change the settings in QGC to “force” it to be connected? Right now my device works with an old version of QGC 2.6 and it does connect to the device without a problem.