"Why do we use P as B' since P is B and Q is B' or I misunderstand?"


It is just a name. You can call it Q if you like.

 

When we are going between 2 non-standard bases then I usually use P for B and Q for B'. But in Q19 we are going between the standard basis and a non-standard basis.

 

So we only have 1 transition matrix to consider. I called it P. You can call it Q if you like since the non-standard basis is called B'. But remember, these are just names. As long as you understand what they represent then it can be called whatever.