He'll be alright. QF and pushing the world #1 to his limits is far more than expected from him on clay, by far his worst surface.
He's strong mentally and will not let the defeat crush, but rather take the positives from it. If he can carry that form into the grass season, especially as far as his backhand is concerned, he will be a force to be reckoned with imo.
Sure he exceeded expectations overall, but the fact that he could have done even more, is going to hurt him for a long, long time.
. Well if he can come back from this, then kudos to him. The moment of truth awaits him on the grass -- will he make or break. Will be a testament to what his true character is.
But really, my advice is to take a good few weeks off and stop thinking about tennis, and just have fun. It's the only way to forget about it.