QLegendreP[n_Integer?NonNegative, x_, q_] := QHypergeometricPFQ[{q^-n, q^(n + 1), q^(1/4) (x + I Sqrt[1 - x^2]), q^(1/4) (x - I Sqrt[1 - x^2])}, {q, -q, -q^(1/2)}, q, q];
Text@TraditionalForm@ Grid[Table[{HoldForm[QLegendreP][n, x, q], Collect[Expand[QLegendreP[n, x, q] // FunctionExpand, x], x, Simplify]}, {n, 0, 5}], Background -> {None, {{Automatic, Lighter@LightGray}}}, Spacings -> {1, 2}, Dividers -> All]