[Tex/LaTex] mark a right-angle in Tikz


I've been stuck here playing with numbers using \draw for ages now. There must be a better way. I want to add this right-angle symbol:
enter image description here
and I don't know how I could do it neatly. Can someone help me out? Thanks. MWE:

    \draw (0.1,-0.2) node[left]{\textcolor{gray}{O}};
    \draw[thick, color=gray,->] (-4,0) -- (8,0) node[right] {\textcolor{black}{$x$}};
    \draw[thick, color=gray, ->] (0,-1) -- (0,5) node[above] {\textcolor{black}{$y$}};  
    \draw (3+2,5)--(-4+2,-1) node[above]{$l_1$};
    \draw (-0.5,5)--(36/7-0.5,-1) node[above]{$l_2$};
    \draw [color=gray, dashed] (1.9, 2.28) node[circle,fill=black,inner sep=0pt,minimum size=3pt, label=left:{\textcolor{black}{$P~~$}}]{}--(4.5,2.28)node[circle,fill=black,inner sep=0pt,minimum size=3pt, label=below right:{\textcolor{black}{$Q$}}]{}--(4.5,4.6) node[circle,fill=black,inner sep=0pt,minimum size=3pt, label= right: {\textcolor{black}{$~R$}}]{};
    \draw (4.5,2.58)--(4.2,2.58)--(4.2,2.28);
    \draw [color=gray, dashed] (1.9, 2.28) --(1.9,-0.3)node[circle,fill=black,inner sep=0pt,minimum size=3pt, label= below left:{\textcolor{black}{$S$}}]{}--(4,-0.3) node[circle,fill=black,inner sep=0pt,minimum size=3pt, label= below:{\textcolor{black}{$T~~~$}}]{};
    \draw (1.9,0)--(2.2,0)--(2.2,-0.3);
    \draw (2.9,2.28) arc (0:45:1cm);
    \node at (2.5,2.5) {$\theta$};
    \draw (3.4,2.28) arc (0:-51:1.5cm);
    \node[rotate=-25] at (2.7,1.9) {$\theta-90^{\circ}$};
    \draw (2.6,1.38) arc (-51:-93:1cm);
    \node at (2.1,1.5) {$\theta$};

Best Answer

With the latest PGF/TikZ, the Angle library supports Right Angle.

The following snippet is taken from the official manual (for 3.1.8b) on page 571 :

\usetikzlibrary {angles}
    \draw (0,0,0)coordinate(O)
      (1,0,0)coordinate(A)-- (O)
      (0,0,1)coordinate(B)-- (O)
      (0,1,0)coordinate(C)-- (O)
      pic[fill=gray,angle radius=4mm] {right angle= A--O--B}
      pic[draw,red,thick,angle eccentricity=.5,pic text=.]{right angle= A--O--C};