From: Marc Mutz Date: Wed, 15 Feb 2012 17:55:25 +0000 (+0100) Subject: QEasingCurve: return QVector for cubic spline representation X-Git-Tag: qt-v5.0.0-alpha1~970 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f63b23afdac47bbf71a7b72fdd965c55b2f60602;p=profile%2Fivi%2Fqtbase.git QEasingCurve: return QVector for cubic spline representation QEasingCurve internally holds the spline data in a QVector. For the return from cubicBezierSpline(), the vector is transformed into a QList. This involves copying, and into an inefficient (for QPointF payloads) container at that, so deprecate cubicBezierSpline() in favour of a new toCubicSpline() returning the QVector directly. Change-Id: Ie4827fe7c6e289ad97a0b09772e47298779c76ca Reviewed-by: Lars Knoll --- diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp index 76c06cb..5731faa 100644 --- a/src/corelib/tools/qeasingcurve.cpp +++ b/src/corelib/tools/qeasingcurve.cpp @@ -1303,14 +1303,20 @@ void QEasingCurve::addTCBSegment(const QPointF &nextPoint, qreal t, qreal c, qre } /*! + \fn QList QEasingCurve::cubicBezierSpline() const + \obsolete Use toCubicSpline() instead. + */ + +/*! + \since 5.0 Returns the cubicBezierSpline that defines a custom easing curve. If the easing curve does not have a custom bezier easing curve the list is empty. - */ -QList QEasingCurve::cubicBezierSpline() const +*/ +QVector QEasingCurve::toCubicSpline() const { - return d_ptr->config ? d_ptr->config->_bezierCurves.toList() : QList(); + return d_ptr->config ? d_ptr->config->_bezierCurves : QVector(); } /*! diff --git a/src/corelib/tools/qeasingcurve.h b/src/corelib/tools/qeasingcurve.h index 4d53af5..ad2e510 100644 --- a/src/corelib/tools/qeasingcurve.h +++ b/src/corelib/tools/qeasingcurve.h @@ -44,7 +44,11 @@ #include #include -#include +#include +#if QT_DEPRECATED_SINCE(5, 0) +# include +# include +#endif QT_BEGIN_HEADER @@ -94,7 +98,10 @@ public: void addCubicBezierSegment(const QPointF & c1, const QPointF & c2, const QPointF & endPoint); void addTCBSegment(const QPointF &nextPoint, qreal t, qreal c, qreal b); - QList cubicBezierSpline() const; + QVector toCubicSpline() const; +#if QT_DEPRECATED_SINCE(5, 0) + QT_DEPRECATED QList cubicBezierSpline() const { return toCubicSpline().toList(); } +#endif Type type() const; void setType(Type type);