From 4e3b4d91073782ef2889c542ca9c287c877dbc50 2012-04-17 08:12:03 From: Michal Klocek Date: 2012-04-17 08:12:03 Subject: [PATCH] minor. Release polishing --- diff --git a/README b/README index a838300..26613cd 100644 --- a/README +++ b/README @@ -2,7 +2,6 @@ Commercial Charts Add-on Preview -------------------------------- - Whats in Qt Commercial Charts ============================= @@ -19,19 +18,25 @@ demos/ combine several chart types and implement interaction in charts doc/ Documentation -Licensing/ +licenses/ Licensing infromation - -Building +Building ======== -qmake -make (linux), mingw32-make (Windows with MinGw) or nmake (Visual Studio) +Configure project with qmake: + qmake CONFIG+=release + +Build poject with make: + (Linux) make + (Windows with MinGw) mingw32-make + (Visual Studio) namke If you want to install the libraries to your Qt library directory use: -make install + make install +If you want to uninstall the libraries + make uninstall Documentation ============= @@ -41,27 +46,15 @@ into "doc/html" in the build directory. KNOWN ISSUES ============ -- General - * The preview version of Qt Commercial Charts is still under development + * The preview version of Qt Commercial Charts is still under development and thus should not be used in e.g. product development - * The Charts API might change between the Preview and first official release - * Some areas will be refactored before the first official release - * Qt Designer plugin is missing - * Enable/disable tooltip is missing from the API - -- QML API - * The QML Bindings are still under development and to be considered as early preview - * All the current QML APIs are shown in qmlchart demo app - * If doing a developer build (not installing into your Qt instance) you - need to copy qmldir file to the qmlplugin installation folder; it is not - copied during build. - -- Model based - -- Bar Chart - * Modifying bar categories is not possible - -- Pie Chart - * Slice labels drawn on top of the label arm - -- Line Chart + * The Charts API might change between the Preview and first official release + * Some areas will be refactored before the first official release + * Qt Designer plugin is missing + * Enable/disable tooltip is missing from the API + * Mutliple axis are not suported at the moment. + * Logartmic, polar axis are not supported at the moment. + * Getting data from QAbstractItemModel is not feature complete. + * Interlnal layout hadnling is not working properly. + * The QML Bindings are still under development and to be considered as early draft + * All the current QML APIs are shown in qmlchart demo app \ No newline at end of file diff --git a/Licenses/LICENSE-ALLOS b/licenses/LICENSE-ALLOS similarity index 100% rename from Licenses/LICENSE-ALLOS rename to licenses/LICENSE-ALLOS diff --git a/Licenses/LICENSE-ALLOS-US b/licenses/LICENSE-ALLOS-US similarity index 100% rename from Licenses/LICENSE-ALLOS-US rename to licenses/LICENSE-ALLOS-US diff --git a/Licenses/LICENSE-DESKTOP b/licenses/LICENSE-DESKTOP similarity index 100% rename from Licenses/LICENSE-DESKTOP rename to licenses/LICENSE-DESKTOP diff --git a/Licenses/LICENSE-DESKTOP-US b/licenses/LICENSE-DESKTOP-US similarity index 100% rename from Licenses/LICENSE-DESKTOP-US rename to licenses/LICENSE-DESKTOP-US diff --git a/Licenses/LICENSE-EVALUATION b/licenses/LICENSE-EVALUATION similarity index 100% rename from Licenses/LICENSE-EVALUATION rename to licenses/LICENSE-EVALUATION diff --git a/Licenses/LICENSE-EVALUATION-US b/licenses/LICENSE-EVALUATION-US similarity index 100% rename from Licenses/LICENSE-EVALUATION-US rename to licenses/LICENSE-EVALUATION-US diff --git a/Licenses/LICENSE.COMMERCIAL.FI b/licenses/LICENSE.COMMERCIAL.FI similarity index 100% rename from Licenses/LICENSE.COMMERCIAL.FI rename to licenses/LICENSE.COMMERCIAL.FI diff --git a/Licenses/LICENSE.COMMERCIAL.US b/licenses/LICENSE.COMMERCIAL.US similarity index 100% rename from Licenses/LICENSE.COMMERCIAL.US rename to licenses/LICENSE.COMMERCIAL.US diff --git a/src/scroller.cpp b/src/scroller.cpp index 8bf3f6c..66319b8 100644 --- a/src/scroller.cpp +++ b/src/scroller.cpp @@ -139,9 +139,9 @@ void Scroller::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) m_state = Idle; } else { - m_speed /= 4; + m_speed /= 3.75; m_state = Scroll; - m_ticker.start(20); + m_ticker.start(25); } event->accept(); break; diff --git a/src/splinechart/qsplineseries.cpp b/src/splinechart/qsplineseries.cpp index 3f6f52b..9c00915 100644 --- a/src/splinechart/qsplineseries.cpp +++ b/src/splinechart/qsplineseries.cpp @@ -100,24 +100,19 @@ QSplineSeriesPrivate::QSplineSeriesPrivate(QSplineSeries* q):QLineSeriesPrivate( }; /*! - \internal Calculates control points which are needed by QPainterPath.cubicTo function to draw the cubic Bezier cureve between two points. */ void QSplineSeriesPrivate::calculateControlPoints() { Q_Q(QSplineSeries); - // Based on http://www.codeproject.com/Articles/31859/Draw-a-Smooth-Curve-through-a-Set-of-2D-Points-wit - // CPOL License int n = q->count() - 1; + if (n == 1) - { // Special case: Bezier curve should be a straight line. - // firstControlPoints = new Point[1]; - // 3P1 = 2P0 + P3 + { + //for n==1 m_controlPoints.append(QPointF((2 * q->x(0) + q->x(1)) / 3, (2 * q->y(0) + q->y(1)) / 3)); - - // P2 = 2P1 P0 m_controlPoints.append(QPointF(2 * m_controlPoints[0].x() - q->x(0), 2 * m_controlPoints[0].y() - q->y(0))); return; } @@ -135,31 +130,31 @@ void QSplineSeriesPrivate::calculateControlPoints() // | 0 0 0 0 0 0 0 0 ... 1 4 1 | | P1_(n-1)| | 4 * P(n-2) + 2 * P(n-1) | // | 0 0 0 0 0 0 0 0 ... 0 2 7 | | P1_n | | 8 * P(n-1) + Pn | // - QList rhs; - rhs.append(q->x(0) + 2 * q->x(1)); + QList points; - // Set right hand side X values - for (int i = 1; i < n - 1; ++i) - rhs.append(4 * q->x(i) + 2 * q->x(i + 1)); + points.append(q->x(0) + 2 * q->x(1)); - rhs.append((8 * q->x(n - 1) + q->x(n)) / 2.0); - // Get first control points X-values - QList xControl = getFirstControlPoints(rhs); - rhs[0] = q->y(0) + 2 * q->y(1); - // Set right hand side Y values for (int i = 1; i < n - 1; ++i) - rhs[i] = 4 * q->y(i) + 2 * q->y(i + 1); + points.append(4 * q->x(i) + 2 * q->x(i + 1)); + + points.append((8 * q->x(n - 1) + q->x(n)) / 2.0); + + QList xControl = firstControlPoints(points); + points[0] = q->y(0) + 2 * q->y(1); + + for (int i = 1; i < n - 1; ++i) { + points[i] = 4 * q->y(i) + 2 * q->y(i + 1); + } + + points[n - 1] = (8 * q->y(n - 1) + q->y(n)) / 2.0; - rhs[n - 1] = (8 * q->y(n - 1) + q->y(n)) / 2.0; - // Get first control points Y-values - QList yControl = getFirstControlPoints(rhs); + QList yControl = firstControlPoints(points); - // Fill output arrays. for (int i = 0; i < n; ++i) { - // First control point + m_controlPoints.append(QPointF(xControl[i], yControl[i])); - // Second control point + if (i < n - 1) m_controlPoints.append(QPointF(2 * q->x(i + 1) - xControl[i + 1], 2 * q->y(i + 1) - yControl[i + 1])); else @@ -167,31 +162,26 @@ void QSplineSeriesPrivate::calculateControlPoints() } } -/*! - \internal - */ -QList QSplineSeriesPrivate::getFirstControlPoints(QList rhs) +QList QSplineSeriesPrivate::firstControlPoints(QList list) { - QList x; // Solution vector. - QList tmp; // Temp workspace. + QList result; + QList temp; qreal b = 2.0; - x.append(rhs[0] / b); - tmp.append(0); - for (int i = 1; i < rhs.size(); i++) { - // Decomposition and forward substitution. - tmp.append(1 / b); - b = (i < rhs.size() - 1 ? 4.0 : 3.5) - tmp[i]; - x.append((rhs[i] - x[i - 1]) / b); + result.append(list[0] / b); + temp.append(0); + for (int i = 1; i < list.size(); i++) { + temp.append(1 / b); + b = (i < list.size() - 1 ? 4.0 : 3.5) - temp[i]; + result.append((list[i] - result[i - 1]) / b); } - for (int i = 1; i < rhs.size(); i++) - x[rhs.size() - i - 1] -= tmp[rhs.size() - i] * x[rhs.size() - i]; // Backsubstitution. + for (int i = 1; i < list.size(); i++) + result[list.size() - i - 1] -= temp[list.size() - i] * result[list.size() - i]; - return x; + return result; } /*! - \internal Updates the control points, besed on currently avaiable knots. */ void QSplineSeriesPrivate::updateControlPoints() diff --git a/src/splinechart/qsplineseries_p.h b/src/splinechart/qsplineseries_p.h index a22caaa..4f38eb7 100644 --- a/src/splinechart/qsplineseries_p.h +++ b/src/splinechart/qsplineseries_p.h @@ -42,7 +42,7 @@ public: Chart* createGraphics(ChartPresenter* presenter); QSplineSeriesPrivate(QSplineSeries* q); void calculateControlPoints(); - QList getFirstControlPoints(QList rhs); + QList firstControlPoints(QList rhs); public Q_SLOTS: void updateControlPoints();