I have been trying to add a WMS map server as a map provider and I could not find any examples. So I will give some direction for whoever is also trying to achieve this by modifying the QGC source code. I wanted to have a base map(openseamap) and AIS as an overlay to visualize marine traffic. However, AIS data source is a WMS server for my case.
QGC already has a solid back-end implementation to fetch from tile servers. So I only had to add a new map provider(MapProvider class) with proper arguments.
First, I did a quick online search and found this wiki https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#C/C++ which shows the algorithm and mathematical formulas to convert tiles to lat/long. Then, I had to convert lat/long to a proper format which the WMS server understands in EPSG:3857
format. I did this math before sending my request in the back-end methods.
To add another map on top, I modified the FlightMap.qml file. Added another Map object(using QGC location plugin) inside an already defined Map object with a different opacity and marine traffic showed up as an overlay.