]> git.sesse.net Git - kdenlive/commitdiff
Bezier Spline: Fix compilation with Qt < 4.6
authorTill Theato <root@ttill.de>
Tue, 4 Jan 2011 06:48:33 +0000 (06:48 +0000)
committerTill Theato <root@ttill.de>
Tue, 4 Jan 2011 06:48:33 +0000 (06:48 +0000)
svn path=/trunk/kdenlive/; revision=5260

src/beziercurve/beziersplineeditor.cpp

index 50735c679019ef721fecf027007bbf1124cdf094..3250feca4557b25b6c682ad6bd1bbc87dd07893e 100644 (file)
@@ -209,6 +209,9 @@ void BezierSplineEditor::paintEvent(QPaintEvent* event)
                      4,  1,
                      1,  4,
                      -2, 1);
+#if QT_VERSION < 0x040600
+    QPolygon tmp;
+#endif
     for (int i = 0; i <= max; ++i) {
         point = m_spline.points().at(i);
         if (i == m_currentPointIndex) {
@@ -221,10 +224,24 @@ void BezierSplineEditor::paintEvent(QPaintEvent* event)
 
         p.drawEllipse(QRectF(point.p.x() * wWidth - 3,
                              wHeight - 3 - point.p.y() * wHeight, 6, 6));
-        if (i != 0)
+        if (i != 0) {
+#if QT_VERSION >= 0x040600
             p.drawConvexPolygon(handle.translated(point.h1.x() * wWidth, wHeight - point.h1.y() * wHeight));
-        if (i != max)
+#else
+            tmp = handle;
+            tmp.translate(point.h1.x() * wWidth, wHeight - point.h1.y() * wHeight);
+            p.drawConvexPolygon(tmp);
+#endif
+        }
+        if (i != max) {
+#if QT_VERSION >= 0x040600
             p.drawConvexPolygon(handle.translated(point.h2.x() * wWidth, wHeight - point.h2.y() * wHeight));
+#else
+            tmp = handle;
+            tmp.translate(handle.translated(point.h2.x() * wWidth, wHeight - point.h2.y() * wHeight);
+            p.drawConvexPolygon(tmp);
+#endif
+        }
 
         if ( i == m_currentPointIndex)
             p.setBrush(QBrush(Qt::NoBrush));