Solution:

Let ∠CBA=α and ∠DBA=β. Then ∠BDA=α and ∠BCA=β. We also observe that ∠AO1O2=(∠AO1B/2)=α and, simiarly, ∠AO2O1=β. Hence
∠O1AO2=180∘−(α+β)
We also have
∠PO1A=2∠DO1A=22∠DBA=∠DBA=β
Hence ∠PO1O2=∠PO1A+∠AO1O2=β+α. Similarly, we can get ∠PO2O1=α+β. It follows that P lies on the perpendicular bisector of O1O2.
Now we observe that
∠XQY=360∘−2∠XAY=360∘−2(180∘−α−β)=2(α+β)
This gives
∠O1QO2=21(∠XQA+∠YQA)=2∠XQY=α+β
This shows that A,O1,O2,Q are concyclic. We also have
∠ABX=∠ABD+∠DBX=β+∠DAX=β+2∠DAB∠ABY=∠ABC+∠CBY=α+∠CAY=α+2∠BAC
Adding we obtain
∠ABX+∠ABY=α+β+21(∠DAB+∠BAC)=α+β+(180∘−α−β)=180∘
Hence X,B,Y are collinear. Now
∠QAX=21(180∘−∠AQX)=90∘−β∠XAO1=21(180∘−∠XO1A)=90∘−21(360∘−2∠ABX)=∠ABX−90∘
Hence
∠QAO1=90∘−β+∠ABX−90∘=∠ABX−β=2∠DAB=2∠O1AO2
This shows that AQ bisects ∠O1AO2 and therefore the chords QO1 and QO2 subtend equal angles on the circumference of the circle passing through QO2AO1. Hence QO2=QO1. This means Q lies on the perpendicular bisector of O1O2.
Combining, we get that PQ is the perpendicular bisector of O1O2.