Quantum devices formed in high-electron-mobility semiconductor heterostructures provide a route through which quantum mechanical effects can be exploited on length scales accessible to lithography and integrated electronics. The electrostatic definition of quantum dots in semiconductor heterostructure devices intrinsically involves the lithographic fabrication of intricate patterns of metallic electrodes. The formation of metal/semiconductor interfaces, growth processes associated with polycrystalline metallic layers, and differential thermal expansion produce elastic distortion in the active areas of quantum devices. Understanding and controlling these distortions presents a significant challenge in quantum device development. We report synchrotron x-ray nanodiffraction measurements combined with dynamical x-ray diffraction modeling that reveal lattice tilts with a depth-averaged value up to 0.04 deg. and strain on the order of 10^-4 in the two-dimensional electron gas (2DEG) in a GaAs/AlGaAs heterostructure. Elastic distortions in GaAs/AlGaAs heterostructures modify the potential energy landscape in the 2DEG due to the generation of a deformation potential and an electric field through the piezoelectric effect. The stress induced by metal electrodes directly impacts the ability to control the positions of the potential minima where quantum dots form and the coupling between neighboring quantum dots.