4. On the outside of the convex quadrilateral $A B C D$, construct: $\triangle A B Q, \triangle B C R, \triangle C D S, \triangle D A P$. Let the sum of the diagonals of quadrilateral $A B C D$ be $x$, and the sum of the lines connecting the midpoints of the opposite sides of quadrilateral $P Q R S$ be $y$. Find the maximum value of $\frac{y}{x}$.
4. When quadrilateral $A B C D$ is a square, we get
$$
\frac{y}{x}=\frac{1+\sqrt{3}}{2} \text {. }
$$

The following is the proof: $\frac{y}{x} \leqslant \frac{1+\sqrt{3}}{2}$.
As shown in Figure 3, let $P_{1} 、 Q_{1} 、 R_{1} 、 S_{1}$ be the midpoints of sides $D A$ 、 $A B 、 B C 、 C D$ respectively, and let $E 、 F 、 G 、 H$ be the midpoints of $S P 、 P Q 、 Q R 、 R S$ respectively. Then quadrilateral $P_{1} Q_{1} R_{1} S_{1}$ is a parallelogram.
Connect $P_{1} E 、 S_{1} E$.
Let $M 、 N$ be the midpoints of $D P 、 D S$ respectively. Then
$$
\begin{array}{l}
D S_{1}=S_{1} N=D N=E M, \\
D P_{1}=P_{1} M=M D=E N . \\
\text { Also } \angle P_{1} D S_{1}=360^{\circ}-60^{\circ}-60^{\circ}-\angle P D S \\
=240^{\circ}-\left(180^{\circ}-\angle E N D\right)=60^{\circ}+\angle E N D \\
=\angle E N S_{1}=\angle E M P_{1} .
\end{array}
$$

Then $\triangle D P_{1} S_{1} \cong \triangle M P_{1} E \cong \triangle N E S_{1}$.
Thus, $\triangle E P_{1} S_{1}$ is an equilateral triangle.
Similarly, $\triangle G Q_{1} R_{1}$ is also an equilateral triangle.
Let $U 、 V$ be the midpoints of $P_{1} S_{1} 、 Q_{1} R_{1}$ respectively. Then
$$
\begin{array}{l}
E G \leqslant E U+U V+V G \\
=\frac{\sqrt{3}}{2} P_{1} S_{1}+P_{1} Q_{1}+\frac{\sqrt{3}}{2} Q_{1} R_{1} \\
=P_{1} Q_{1}+\sqrt{3} P_{1} S_{1}=\frac{1}{2} B D+\frac{\sqrt{3}}{2} A C .
\end{array}
$$

Similarly, $F H \leqslant \frac{1}{2} A C+\frac{\sqrt{3}}{2} B D$.
Adding the above two inequalities, we get $y \leqslant \frac{1+\sqrt{3}}{2} x$, which means
$$
\frac{y}{x} \leqslant \frac{1+\sqrt{3}}{2} \text {. }
$$