With a new unifying model for layered rotating shallow-water (RSW) and quasi-geostrophic (QG) equations, this paper sheds light on the relation between these two sets of equations. We propose here a new formulation of the quasi-geostrophic equations as a projection of the rotating shallow-water equations. This QG formulation uses the same prognostic variables as RSW, namely velocity and layer thickness, restoring the proximity of these two sets of equations. It allows direct access to the ageostrophic velocities hidden in geostrophic velocities resolved by the QG equations. It opens the path of studying the difference between QG and RSW using the same underlying numerical discretization. We illustrate this new possibility on a vortex shear instability and a double-gyre configuration.