You need to expand your truth table to include the value of CLK before and after a transition. Qn does not matter when deciding what Qn+1 will be. Qn+1 will be the same as D whenever CLK goes through a transition from 0 to 1, provided that value of D remained constant during the setup and hold times around the CLK transition. And Q will remain in that state until the next 0 to 1 transition on CLK. (Note: some D flip-flops use the opposite transition of CLK, from 1 to 0.)