You already answered, but yeah, the "trick" is that the check for the Q stack happens after Diana reaches the enemy, so if a Q is mid-flight when you use R it reaches the target in time for the refresh to happen.
be careful trying to "abuse" that, if opponent dashes during your R, the Q will miss and you won't get the refresh