We present a design of superconducting magnets, optimized for application in a gantry for proton therapy. We have introduced a new magnet design concept, called an alternating-gradient canted cosine theta (AG-CCT) concept, which is compatible with an achromatic layout. This layout allows a large momentum acceptance. The 15 cm radius of the bore aperture enables the application of pencil beam scanning in front of the SC-magnet. The optical and dynamic performance of a gantry based on these magnets has been analyzed using the fields derived (via Biot-Savart law) from the actual windings of the AG-CCT combined with the full equations of motion. The results show that with appropriate higher order correction, a large 3D volume can be rapidly scanned with little beam shape distortion. A very big advantage is that all this can be done while keeping the AG-CCT fields fixed. This reduces the need for fast field ramping of the superconducting magnets between the successive beam energies used for the scanning in depth and it is important for medical application since this reduces the technical risk (e.g., a quench) associated with fast field changes in superconducting magnets. For proton gantries the corresponding superconducting magnet system holds promise of dramatic reduction in weight. For heavier ion gantries there may furthermore be a significant reduction in size.