You may have identified your own problem.
Your camera is either a
Nikon d40 or a Canon EOS 40d (aka Digital Rebel), there's no such thing as a Canon d40.
If your Quantaray flash has the wrong brand dedication module on the bottom for your brand then it won't work properly (if at all).
If this is not the cause, then please be more descriptive: does the flash power up at all, will it work with other cameras, do other external flashes work on your camera? You may just need to go into the menu and enable the hotshoe.
Click here as well if you lack an operation manual: Quantaray products are always a pain to find manuals for as they're badge-engineered models supplied in the USA by Ritz/Wolf. The trick is always to find what the individual product is usually sold as. In your case, it's a ProMaster FTD5700. Page 2 of the manual will help you to identify which dedicated module you need for this flash to work with your camera.
I hope that I've helped, if not then please report back with additional details, or if I've helped you to solve your problem then please take a moment to rate my answer.