In terms of the IBA spec, it is optional as to what link speeds are supported (other than SDR). You can tell by smpquery portinfo for one of the switch external/physical ports.
If you are talking about Mellanox EDR switch, it supports QDR as well as some other speeds (like FDR and FDR10).
EDR capable <-> QDR capable link should come up at QDR.
EDR capable <-> EDR capable link should come up at EDR.
If EDR node talks to other EDR node across all EDR links, rate will be 100 Gbps (4x EDR).
When EDR node talks to QDR node, rate will be 40 Gbps (4x QDR).
When EDR node talks to other EDR node with intervening QDR link on path, rate will also be 40 Gbps.