In QT designer you need make right click on the widget and select "promote to", and write the class and header as seen in the image.

after you need compile the .ui.
In the class that loads this ui, to load some layer for example (this canvas have a objectname "canvas")
def __init__(self):
""" Contructor """
QDialog.__init__(self)
self.setupUi(self)
# Load layers
self.airports = QgsVectorLayer(r"C:\Users\fran\Downloads\qgis_sample_data\qgis_sample_data\shapefiles\airports.shp", " airports ", "ogr")
self.canvas.setLayers([self.airports])
self.canvas.setExtent(self.airports.extent())
self.canvas.refresh()
self.canvas.waitWhileRendering()
# Extra : set pan tool in this canvas
self.tool = QgsMapToolPan(self.canvas)
self.canvas.setMapTool(self.tool)
Result
