In Part A of the following, $\vec{F}$ goes from $\langle y-x,x \rangle$ to $\langle cos(t)-\sin(t),\sin(t) \rangle$ with very little explanation:
I would have thought that $\vec{r}(t)=\langle \cos(t),\sin(t)\rangle$ and $\vec{F}=\langle \sin(t)-\cos(t),cos(t)\rangle$
Why are both the other way around?

You'll trace C clockwise from P to Q, but the value of t will progress from one end of the domain of $\vec{r}$ to the other.
To only get values between ( and including ) P and R, the domain of $\vec{r}$ must be $\big[\ 0,\ \pi / 2\ \big]$
Note that $t$ can traverse the values of $\vec{r}$'s domain in either direction: you can start by calculating $\vec{r}(t)$ at $\pi / 2$ or $0$. But, you must pick a direction, make note of it, and then ask yourself the following question:
If $a=0$, $\vec{r}(0)=\langle 0,1\rangle = P$ only if $\vec{r}(t)=\langle \sin t,\cos t\rangle$
If $a=\pi / 2$, $\vec{r}(\pi / 2)=\langle 0,1\rangle = P$ only if $\vec{r}(t)=\langle \cos t,\sin t\rangle$
Part A of the example above uses the first definition of $\vec{r}(t)$. So, the example will be calculating the integral from $0$ to $\pi / 2$:
$\int_0^{\pi/2}\vec{F}\cdot\vec{r}'(t)dt$
If we were to traverse the domain of $\vec{r}$ in the opposite direction, $\vec{r}(t)$ would be $\langle \cos t,\sin t\rangle$, and the integral would be:
$\int^0_{\pi/2}\vec{F}\cdot\vec{r}'(t)dt$