Index: mathed/InsetMathRoot.cpp
===================================================================
--- mathed/InsetMathRoot.cpp	(Revision 18271)
+++ mathed/InsetMathRoot.cpp	(Arbeitskopie)
@@ -61,14 +61,15 @@
 	cell(1).draw(pi, x + w + 8, y);
 	int const a = dim_.ascent();
 	int const d = dim_.descent();
-	int xp[5];
-	int yp[5];
-	xp[0] = x + dim_.width();  yp[0] = y - a + 1;
-	xp[1] = x + w + 4;         yp[1] = y - a + 1;
-	xp[2] = x + w;             yp[2] = y + d;
-	xp[3] = x + w - 2;         yp[3] = y + (d - a)/2 + 2;
-	xp[4] = x + w - 5;         yp[4] = y + (d - a)/2 + 4;
-	pi.pain.lines(xp, yp, 5, Color::math);
+	int xp[4];
+	int yp[4];
+	pi.pain.line(x + dim_.width(), y - a + 1,
+							 x + w + 4, y - a + 1, Color::math);
+	xp[0] = x + w + 4;         yp[0] = y - a + 1;
+	xp[1] = x + w;             yp[1] = y + d;
+	xp[2] = x + w - 2;         yp[2] = y + (d - a)/2 + 2;
+	xp[3] = x + w - 5;         yp[3] = y + (d - a)/2 + 4;
+	pi.pain.lines(xp, yp, 4, Color::math);
 	drawMarkers(pi, x, y);
 }
 
Index: mathed/InsetMathSqrt.cpp
===================================================================
--- mathed/InsetMathSqrt.cpp	(Revision 18271)
+++ mathed/InsetMathSqrt.cpp	(Arbeitskopie)
@@ -53,13 +53,14 @@
 	cell(0).draw(pi, x + 10, y);
 	int const a = dim_.ascent();
 	int const d = dim_.descent();
-	int xp[4];
-	int yp[4];
-	xp[0] = x + dim_.width(); yp[0] = y - a + 1;
-	xp[1] = x + 8;            yp[1] = y - a + 1;
-	xp[2] = x + 5;            yp[2] = y + d - 1;
-	xp[3] = x;                yp[3] = y + (d - a)/2;
-	pi.pain.lines(xp, yp, 4, Color::math);
+	int xp[3];
+	int yp[3];
+	pi.pain.line(x + dim_.width(), y - a + 1,
+							 x + 8, y - a + 1, Color::math);
+	xp[0] = x + 8;            yp[0] = y - a + 1;
+	xp[1] = x + 5;            yp[1] = y + d - 1;
+	xp[2] = x;                yp[2] = y + (d - a)/2;
+	pi.pain.lines(xp, yp, 3, Color::math);
 	drawMarkers(pi, x, y);
 }
 
Index: frontends/qt4/QLPainter.cpp
===================================================================
--- frontends/qt4/QLPainter.cpp	(Revision 18271)
+++ frontends/qt4/QLPainter.cpp	(Arbeitskopie)
@@ -113,16 +113,22 @@
 {
 	if (!isDrawingEnabled())
 		return;
-
+	
+	// Must use new as np is not known at compile time.
+	boost::scoped_array<QPoint> points(new QPoint[np]);
+	
+	bool antialias = false;
+	for (int i = 0; i < np; ++i) {
+		points[i].setX(xp[i]);
+		points[i].setY(yp[i]);
+		if (i != 0) 
+			antialias |= xp[i-1] != xp[i] && yp[i-1] != yp[i];
+	}
+ 	setQPainterPen(col, ls, lw);
 	bool const text_is_antialiased = renderHints() & TextAntialiasing;
-	setQPainterPen(col, ls, lw);
-	for (int i = 1; i < np; ++i) {
-		bool const do_antialiasing = text_is_antialiased 
-			&& xp[i-1] != xp[i] && yp[i-1] != yp[i];
-		setRenderHint(Antialiasing, do_antialiasing);
-		drawLine(xp[i-1], yp[i-1], xp[i], yp[i]);
-		setRenderHint(Antialiasing, false);
-	}
+	setRenderHint(Antialiasing, antialias && text_is_antialiased);
+	drawPolyline(points.get(), np);
+	setRenderHint(Antialiasing, false);
 }
 
 
