Any luck with that 3NT contract?
I would imagine that the first attempt of many players was along these lines: Win the lead in dummy and play the King of diamonds. West has to duck (else you have easy 9 tricks: 2 spades, 3 hearts, 3 diamonds, 1 club). Now you come to your hand with the heart Queen and drive out the Ace of diamonds. Win the next trick in dummy, cash all of dummy's black winners, and put East in with a heart. He will have only diamonds to play, and so you will get your diamond tricks in the end.
A good enough plan. It is a pity that East can wreck it by saving the 2 of hearts to play underneath dummy's 4th heart. He will lose a trick doing that, but you will not get to 9 tricks: 2 spades, 4 hearts, 1 diamond and 1 club is 8 tricks, and dummy will be stuck with a lot of clubs, allowing West to win a club trick and cash spades.
The solution is very beautiful and anti-intuitive. Win trick 1 in dummy, play the King of diamonds, ducked. Lead a heart to the Queen. And drive out the Ace of diamonds discarding a heart honor from dummy. This neutralizes the threat of being stuck in dummy with the 4th heart, but reduces your trick count to 8 (2 spades, 2 hearts, 3 diamonds, 1 club). No worries. Look at how the play develops after this trick.
West will win the Ace of diamonds and play a spade (probably -- nothing he does makes a difference). You will win in dummy, cash the remaining heart honor and play a heart to your 8. Ducking this trick will not help East, so he will win the heart and probably cash the 4th heart. You discard a club from each hand. Now East tries to lose the lead by playing the Queen of clubs, but you duck it in both hands (West cannot play the King of clubs to advantage -- it would only create a trick and an entry to your hand). And East finally has to play a diamond to your hand. When you cash the diamonds, this is the position (as you are leading the last diamond):
West is squeezed in the black suits.
If East plays a diamond before the Queen of clubs, no problem. We duck a club ourselves, and reach the same position. If West leads a club rather than a spade after he wins the diamond Ace, we cash the remaining spade honor in dummy, before leading hearts to give the lead to East.
What is probably the most dangerous trap to avoid is to cash a heart honor before leading a heart to your Queen. If you do that, now the timing becomes favorable to the defense: West will lead a club after winning the Ace of diamonds. You will have to duck. And East, after winning the Queen of clubs, will be able to cash hearts and lead a spade, giving the lead to dummy at a most inconvenient moment. You need one heart honor in dummy to prevent that, and so the only winning line is the one described above.