diff options
39 files changed, 104 insertions, 168 deletions
diff --git a/src/declarative/declarative.pro b/src/declarative/declarative.pro index 9f555fe..4bf267c 100644 --- a/src/declarative/declarative.pro +++ b/src/declarative/declarative.pro @@ -19,7 +19,6 @@ include(util/util.pri) include(fx/fx.pri) include(canvas/canvas.pri) include(qml/qml.pri) -include(timeline/timeline.pri) include(extra/extra.pri) include(widgets/widgets.pri) include(test/test.pri) diff --git a/src/declarative/extra/qfxflowview.cpp b/src/declarative/extra/qfxflowview.cpp index 254e423..412cbc8 100644 --- a/src/declarative/extra/qfxflowview.cpp +++ b/src/declarative/extra/qfxflowview.cpp @@ -199,8 +199,6 @@ void QFxFlowView::reflowDrag(const QPointF &dp) qreal maxY = 0; qreal x = 0; - int flowedItems = 0; - clearTimeLine(); QList<QFxItem *> items; @@ -316,6 +314,7 @@ QRectF QFxFlowView::rectForItem(int idx) const void QFxFlowView::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { + Q_UNUSED(event); if (m_dragItem) { m_dragItem->setZ(0); diff --git a/src/declarative/extra/qfxflowview.h b/src/declarative/extra/qfxflowview.h index 2bec6a1..126f567 100644 --- a/src/declarative/extra/qfxflowview.h +++ b/src/declarative/extra/qfxflowview.h @@ -42,7 +42,7 @@ #ifndef QFXFLOWVIEW_H #define QFXFLOWVIEW_H -#include <QtDeclarative/QmlTimeLine> +#include <private/qmltimeline_p.h> #include <QtDeclarative/qfxitem.h> QT_BEGIN_HEADER diff --git a/src/declarative/extra/qfxparticles.cpp b/src/declarative/extra/qfxparticles.cpp index 62fe4c1..3130f06 100644 --- a/src/declarative/extra/qfxparticles.cpp +++ b/src/declarative/extra/qfxparticles.cpp @@ -54,7 +54,7 @@ #define INT_MAX 2147483647 #endif #include <qfxpixmap.h> -#include <qfxperf.h> +#include <private/qfxperf_p.h> #include <private/qmlanimation_p.h> #include "qfxparticles.h" diff --git a/src/declarative/extra/qmlfolderlistmodel.cpp b/src/declarative/extra/qmlfolderlistmodel.cpp index 8b008a5..acee5e1 100644 --- a/src/declarative/extra/qmlfolderlistmodel.cpp +++ b/src/declarative/extra/qmlfolderlistmodel.cpp @@ -51,7 +51,7 @@ class QmlFolderListModelPrivate : public QObjectPrivate public: QmlFolderListModelPrivate() : count(0) { folder = QDir::currentPath(); - nameFilters << "*"; + nameFilters << QLatin1String("*"); } QDirModel model; @@ -81,6 +81,7 @@ QmlFolderListModel::~QmlFolderListModel() QHash<int,QVariant> QmlFolderListModel::data(int index, const QList<int> &roles) const { + Q_UNUSED(roles); Q_D(const QmlFolderListModel); QHash<int,QVariant> folderData; QModelIndex modelIndex = d->model.index(index, 0, d->folderIndex); diff --git a/src/declarative/fx/qfxcomponentinstance.cpp b/src/declarative/fx/qfxcomponentinstance.cpp index d3f7061..7f592a9 100644 --- a/src/declarative/fx/qfxcomponentinstance.cpp +++ b/src/declarative/fx/qfxcomponentinstance.cpp @@ -41,7 +41,7 @@ #include "qfxcomponentinstance.h" #include "qfxcomponentinstance_p.h" -#include <qfxperf.h> +#include <private/qfxperf_p.h> #include <qfxcontentwrapper.h> #include <QtDeclarative/qmlinfo.h> diff --git a/src/declarative/fx/qfxflickable_p.h b/src/declarative/fx/qfxflickable_p.h index a3b1500..28ec6d8 100644 --- a/src/declarative/fx/qfxflickable_p.h +++ b/src/declarative/fx/qfxflickable_p.h @@ -57,7 +57,7 @@ #include "qfxflickable.h" #include "qfxitem_p.h" #include "qml.h" -#include "qmltimelinevalueproxy.h" +#include "private/qmltimeline_p.h" #include "private/qmlanimation_p.h" QT_BEGIN_NAMESPACE diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp index 58d597a..539ad02 100644 --- a/src/declarative/fx/qfximage.cpp +++ b/src/declarative/fx/qfximage.cpp @@ -41,7 +41,7 @@ #include "qfximage.h" #include "qfximage_p.h" -#include <qfxperf.h> +#include <private/qfxperf_p.h> #if defined(QFX_RENDER_OPENGL) #include <glsave.h> #endif diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index 7ccad5f..223af60 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -47,7 +47,7 @@ #include <QNetworkRequest> #include <QGraphicsSceneMouseEvent> #include <QtScript/qscriptengine.h> -#include <qfxperf.h> +#include <private/qfxperf_p.h> #include "qmlengine.h" #include "qmlstate.h" diff --git a/src/declarative/fx/qfxlayouts.cpp b/src/declarative/fx/qfxlayouts.cpp index af51318..20e7c7c 100644 --- a/src/declarative/fx/qfxlayouts.cpp +++ b/src/declarative/fx/qfxlayouts.cpp @@ -45,7 +45,7 @@ #include "qmlstate.h" #include "qmlstategroup.h" #include "qmlstateoperations.h" -#include "qfxperf.h" +#include "private/qfxperf_p.h" #include "qfxlayouts.h" #include "qfxlayouts_p.h" diff --git a/src/declarative/fx/qfxpath.cpp b/src/declarative/fx/qfxpath.cpp index be731b1..4c241d3 100644 --- a/src/declarative/fx/qfxpath.cpp +++ b/src/declarative/fx/qfxpath.cpp @@ -41,7 +41,7 @@ #include "qfxpath.h" #include "qfxpath_p.h" -#include <qfxperf.h> +#include <private/qfxperf_p.h> #include <private/qbezier_p.h> diff --git a/src/declarative/fx/qfxpathview_p.h b/src/declarative/fx/qfxpathview_p.h index b5c5ba2..b77c2a0 100644 --- a/src/declarative/fx/qfxpathview_p.h +++ b/src/declarative/fx/qfxpathview_p.h @@ -58,7 +58,6 @@ #include "qfxitem_p.h" #include "qfxvisualitemmodel.h" #include "qml.h" -#include "qmltimelinevalueproxy.h" #include "private/qmlanimation_p.h" QT_BEGIN_NAMESPACE diff --git a/src/declarative/fx/qfxpixmap.cpp b/src/declarative/fx/qfxpixmap.cpp index 0ea94f5..5ee6528 100644 --- a/src/declarative/fx/qfxpixmap.cpp +++ b/src/declarative/fx/qfxpixmap.cpp @@ -43,7 +43,7 @@ #include <QHash> #include <QNetworkReply> #include <QPixmapCache> -#include <qfxperf.h> +#include <private/qfxperf_p.h> #include <QtDeclarative/qmlengine.h> #include <QFile> diff --git a/src/declarative/fx/qfxtext.cpp b/src/declarative/fx/qfxtext.cpp index d1e118d..f2519dc 100644 --- a/src/declarative/fx/qfxtext.cpp +++ b/src/declarative/fx/qfxtext.cpp @@ -48,7 +48,7 @@ #include "glbasicshaders.h" #endif -#include <qfxperf.h> +#include <private/qfxperf_p.h> #include <QTextLayout> #include <QTextLine> #include <QTextDocument> diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp index 03dd63f..7f08fba 100644 --- a/src/declarative/fx/qfxtextedit.cpp +++ b/src/declarative/fx/qfxtextedit.cpp @@ -48,7 +48,7 @@ #include "glbasicshaders.h" #endif -#include <qfxperf.h> +#include <private/qfxperf_p.h> #include "qfxevents_p.h" #include <QTextLayout> #include <QTextLine> diff --git a/src/declarative/qml/qmlbasicscript.cpp b/src/declarative/qml/qmlbasicscript.cpp index 8b0cb42..0cfb587 100644 --- a/src/declarative/qml/qmlbasicscript.cpp +++ b/src/declarative/qml/qmlbasicscript.cpp @@ -45,7 +45,7 @@ #include <private/qmlengine_p.h> #include <private/qmlcontext_p.h> #include <QStack> -#include <qfxperf.h> +#include <private/qfxperf_p.h> #include <private/qmlrefcount_p.h> #include <private/qmljsast_p.h> #include <private/qmljsengine_p.h> diff --git a/src/declarative/qml/qmlbindablevalue.cpp b/src/declarative/qml/qmlbindablevalue.cpp index f447d4f..8e74250 100644 --- a/src/declarative/qml/qmlbindablevalue.cpp +++ b/src/declarative/qml/qmlbindablevalue.cpp @@ -45,7 +45,7 @@ #include <qmlcontext.h> #include <qmlinfo.h> #include <QVariant> -#include <qfxperf.h> +#include <private/qfxperf_p.h> #include <QtCore/qdebug.h> Q_DECLARE_METATYPE(QList<QObject *>); diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index 47f69a0..bb9f90c 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "private/qmlcompiler_p.h" -#include <qfxperf.h> +#include <private/qfxperf_p.h> #include "qmlparser_p.h" #include "private/qmlscriptparser_p.h" #include <qmlpropertyvaluesource.h> diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp index 293082f..d6b38c9 100644 --- a/src/declarative/qml/qmlcomponent.cpp +++ b/src/declarative/qml/qmlcomponent.cpp @@ -46,7 +46,7 @@ #include "qmlvme_p.h" #include "qml.h" #include <QStack> -#include <qfxperf.h> +#include <private/qfxperf_p.h> #include <QStringList> #include <qmlengine.h> #include <QFileInfo> diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index d645fb3..ad3f4b6 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -57,7 +57,7 @@ #include <QDebug> #include <QMetaObject> #include "qml.h" -#include <qfxperf.h> +#include <private/qfxperf_p.h> #include <QStack> #include "private/qmlbasicscript_p.h" #include "private/qmlcompiledcomponent_p.h" diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp index 307f76f..90acd72 100644 --- a/src/declarative/qml/qmlmetaproperty.cpp +++ b/src/declarative/qml/qmlmetaproperty.cpp @@ -42,7 +42,7 @@ #include "qmlmetaproperty.h" #include "qmlmetaproperty_p.h" #include <qml.h> -#include <qfxperf.h> +#include <private/qfxperf_p.h> #include <QStringList> #include <qmlbindablevalue.h> #include <qmlcontext.h> @@ -1002,7 +1002,7 @@ QMetaMethod QmlMetaProperty::method() const */ QmlMetaProperty QmlMetaProperty::createProperty(QObject *obj, const QString &name) { - QStringList path = name.split('.'); + QStringList path = name.split(QLatin1Char('.')); QObject *object = obj; diff --git a/src/declarative/qml/qmlparser.cpp b/src/declarative/qml/qmlparser.cpp index df5e26e..2e7eb69 100644 --- a/src/declarative/qml/qmlparser.cpp +++ b/src/declarative/qml/qmlparser.cpp @@ -48,7 +48,7 @@ #include <QRectF> #include <private/qmlvme_p.h> #include <qmlbindablevalue.h> -#include <qfxperf.h> +#include <private/qfxperf_p.h> #include <qml.h> #include "private/qmlcomponent_p.h" #include <qmlcomponent.h> diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 7475943..a256978 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -55,7 +55,7 @@ #include <QCoreApplication> #include <QtDebug> -#include <qfxperf.h> +#include <private/qfxperf_p.h> QT_BEGIN_NAMESPACE diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp index 962d917..d24c03e 100644 --- a/src/declarative/qml/qmlvme.cpp +++ b/src/declarative/qml/qmlvme.cpp @@ -40,14 +40,13 @@ ****************************************************************************/ #include "qmlvme_p.h" -#include <qfxperf.h> +#include <private/qfxperf_p.h> #include <private/qmlboundsignal_p.h> #include <private/qmlstringconverters_p.h> #include "private/qmetaobjectbuilder_p.h" #include "private/qmldeclarativedata_p.h" #include <qml.h> #include <private/qmlcustomparser_p.h> -#include <qperformancelog.h> #include <QStack> #include <QWidget> #include <private/qmlcompiledcomponent_p.h> diff --git a/src/declarative/test/qfxtestengine.cpp b/src/declarative/test/qfxtestengine.cpp index 0d7e5df..cf746db 100644 --- a/src/declarative/test/qfxtestengine.cpp +++ b/src/declarative/test/qfxtestengine.cpp @@ -41,7 +41,7 @@ #include <QFile> #include <QmlComponent> -#include <qmltimeline.h> +#include <private/qmltimeline_p.h> #include "qfxtestengine.h" #include "qfxtestobjects.h" #include <QCryptographicHash> diff --git a/src/declarative/timeline/qmltimelinevalueproxy.h b/src/declarative/timeline/qmltimelinevalueproxy.h deleted file mode 100644 index 9ecdba1..0000000 --- a/src/declarative/timeline/qmltimelinevalueproxy.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLTIMELINEVALUEPROXY_H -#define QMLTIMELINEVALUEPROXY_H - -#include <QtDeclarative/qmltimeline.h> - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -template<class T> -class QmlTimeLineValueProxy : public QmlTimeLineValue -{ -public: - QmlTimeLineValueProxy(T *cls, void (T::*func)(qreal), qreal v = 0.) - : QmlTimeLineValue(v), _class(cls), _setFunctionReal(func), _setFunctionInt(0) - { - Q_ASSERT(_class); - } - - QmlTimeLineValueProxy(T *cls, void (T::*func)(int), qreal v = 0.) - : QmlTimeLineValue(v), _class(cls), _setFunctionReal(0), _setFunctionInt(func) - { - Q_ASSERT(_class); - } - - virtual void setValue(qreal v) - { - QmlTimeLineValue::setValue(v); - if (_setFunctionReal) (_class->*_setFunctionReal)(v); - else if (_setFunctionInt) (_class->*_setFunctionInt)((int)v); - } - -private: - T *_class; - void (T::*_setFunctionReal)(qreal); - void (T::*_setFunctionInt)(int); -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif//QMLTIMELINEVALUEPROXY_H diff --git a/src/declarative/timeline/timeline.pri b/src/declarative/timeline/timeline.pri deleted file mode 100644 index a7b3cb9..0000000 --- a/src/declarative/timeline/timeline.pri +++ /dev/null @@ -1,7 +0,0 @@ -SOURCES += \ - timeline/qmltimeline.cpp \ - -HEADERS += \ - timeline/qmltimeline.h \ - timeline/qmltimelinevalueproxy.h \ - diff --git a/src/declarative/util/qfxperf.cpp b/src/declarative/util/qfxperf.cpp index 9ac9e8d..db56b37 100644 --- a/src/declarative/util/qfxperf.cpp +++ b/src/declarative/util/qfxperf.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qfxperf.h" +#include "private/qfxperf_p.h" QT_BEGIN_NAMESPACE diff --git a/src/declarative/util/qfxperf.h b/src/declarative/util/qfxperf_p.h index 0bc0cc9..a1e38b7 100644 --- a/src/declarative/util/qfxperf.h +++ b/src/declarative/util/qfxperf_p.h @@ -41,7 +41,18 @@ #ifndef QFXPERF_H #define QFXPERF_H -#include "qperformancelog.h" +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "private/qperformancelog_p.h" QT_BEGIN_HEADER diff --git a/src/declarative/util/qfxview.cpp b/src/declarative/util/qfxview.cpp index 0855224..0a3afda 100644 --- a/src/declarative/util/qfxview.cpp +++ b/src/declarative/util/qfxview.cpp @@ -54,8 +54,8 @@ #include "qmlbindablevalue.h" #include "qml.h" #include "qfxitem.h" -#include "qperformancelog.h" -#include "qfxperf.h" +#include "private/qperformancelog_p.h" +#include "private/qfxperf_p.h" #include "qfxview.h" #include <QtDeclarative/qmlengine.h> diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp index 6ad47f5..c0d6481 100644 --- a/src/declarative/util/qmlanimation.cpp +++ b/src/declarative/util/qmlanimation.cpp @@ -58,12 +58,6 @@ #include <private/qmlstringconverters_p.h> #include <private/qvariantanimation_p.h> -/* TODO: - Check for any memory leaks - easing should be a QEasingCurve-type property - All other XXXs and ###s -*/ - QT_BEGIN_NAMESPACE QEasingCurve stringToCurve(const QString &curve) @@ -1108,7 +1102,7 @@ void QmlParentChangeActionPrivate::init() void QmlParentChangeActionPrivate::doAction() { - //XXX property.write(value); + //### property.write(value); } void QmlParentChangeAction::prepare(QmlMetaProperty &p) @@ -1120,7 +1114,7 @@ void QmlParentChangeAction::prepare(QmlMetaProperty &p) else d->property = d->userProperty; - //XXX + //### } QAbstractAnimation *QmlParentChangeAction::qtAnimation() @@ -1239,7 +1233,7 @@ QmlNumberAnimation::~QmlNumberAnimation() qreal QmlNumberAnimation::from() const { Q_D(const QmlPropertyAnimation); - return d->from.toDouble(); //### toFloat? + return d->from.toDouble(); } void QmlNumberAnimation::setFrom(qreal f) @@ -1259,7 +1253,7 @@ void QmlNumberAnimation::setFrom(qreal f) qreal QmlNumberAnimation::to() const { Q_D(const QmlPropertyAnimation); - return d->to.toDouble(); //### toFloat? + return d->to.toDouble(); } void QmlNumberAnimation::setTo(qreal t) @@ -1346,7 +1340,7 @@ void QmlSequentialAnimation::transition(QmlStateActions &actions, from = d->animations.count() - 1; } - //### needed for Behavior + //needed for Behavior if (d->userProperty.isValid() && d->propertyName.isEmpty() && !target()) { for (int i = 0; i < d->animations.count(); ++i) d->animations.at(i)->setTarget(d->userProperty); @@ -1428,7 +1422,7 @@ void QmlParallelAnimation::transition(QmlStateActions &actions, { Q_D(QmlAnimationGroup); - //### needed for Behavior + //needed for Behavior if (d->userProperty.isValid() && d->propertyName.isEmpty() && !target()) { for (int i = 0; i < d->animations.count(); ++i) d->animations.at(i)->setTarget(d->userProperty); @@ -1441,22 +1435,8 @@ void QmlParallelAnimation::transition(QmlStateActions &actions, QML_DEFINE_TYPE(QmlParallelAnimation,ParallelAnimation) -//### profile and optimize -QVariant QmlPropertyAnimationPrivate::interpolateVariant(const QVariant &from, const QVariant &to, qreal progress) -{ - if (from.userType() != to.userType()) - return QVariant(); - - QVariantAnimation::Interpolator interpolator = QVariantAnimationPrivate::getInterpolator(from.userType()); - if (interpolator) - return interpolator(from.constData(), to.constData(), progress); - else - return QVariant(); -} - //convert a variant from string type to another animatable type //### should use any registered string convertor -//### profile and optimize void QmlPropertyAnimationPrivate::convertVariant(QVariant &variant, QVariant::Type type) { if (variant.type() != QVariant::String) { @@ -1743,6 +1723,7 @@ void QmlPropertyAnimationPrivate::valueChanged(qreal r) if (!fromIsDefined) { from = property.read(); convertVariant(from, (QVariant::Type)(interpolatorType ? interpolatorType : property.propertyType())); + //### check for invalid variant if using property type } fromSourced = true; } @@ -1752,8 +1733,6 @@ void QmlPropertyAnimationPrivate::valueChanged(qreal r) } else { if (interpolator) property.write(interpolator(from.constData(), to.constData(), r)); - else - property.write(interpolateVariant(from, to, r)); //### optimize } } @@ -1771,9 +1750,15 @@ void QmlPropertyAnimation::prepare(QmlMetaProperty &p) else d->property = d->userProperty; - d->convertVariant(d->to, (QVariant::Type)(d->interpolatorType ? d->interpolatorType : d->property.propertyType())); + int propType = d->property.propertyType(); + d->convertVariant(d->to, (QVariant::Type)(d->interpolatorType ? d->interpolatorType : propType)); if (d->fromIsDefined) - d->convertVariant(d->from, (QVariant::Type)(d->interpolatorType ? d->interpolatorType : d->property.propertyType())); + d->convertVariant(d->from, (QVariant::Type)(d->interpolatorType ? d->interpolatorType : propType)); + + if (!d->interpolatorType) { + //### check for invalid variants + d->interpolator = QVariantAnimationPrivate::getInterpolator(propType); + } d->fromSourced = false; d->value.QmlTimeLineValue::setValue(0.); diff --git a/src/declarative/util/qmlanimation_p.h b/src/declarative/util/qmlanimation_p.h index fce5eca..00759e1 100644 --- a/src/declarative/util/qmlanimation_p.h +++ b/src/declarative/util/qmlanimation_p.h @@ -63,7 +63,7 @@ #include <QtDeclarative/qmlanimation.h> #include <QtDeclarative/qml.h> #include <QtDeclarative/qmlcontext.h> -#include <QtDeclarative/qmltimelinevalueproxy.h> +#include <private/qmltimeline_p.h> QT_BEGIN_NAMESPACE diff --git a/src/declarative/util/qmlscript.cpp b/src/declarative/util/qmlscript.cpp index ab095b1..07cc1d5 100644 --- a/src/declarative/util/qmlscript.cpp +++ b/src/declarative/util/qmlscript.cpp @@ -55,7 +55,7 @@ #include <QNetworkReply> #include <QNetworkRequest> #include <QtDeclarative/qmlinfo.h> -#include <qfxperf.h> +#include <private/qfxperf_p.h> QT_BEGIN_NAMESPACE diff --git a/src/declarative/timeline/qmltimeline.cpp b/src/declarative/util/qmltimeline.cpp index dcc8745..5ba310d 100644 --- a/src/declarative/timeline/qmltimeline.cpp +++ b/src/declarative/util/qmltimeline.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qmltimeline.h" +#include "qmltimeline_p.h" #include <QDebug> #include <QMutex> #include <QThread> diff --git a/src/declarative/timeline/qmltimeline.h b/src/declarative/util/qmltimeline_p.h index 627ec79..abed80a 100644 --- a/src/declarative/timeline/qmltimeline.h +++ b/src/declarative/util/qmltimeline_p.h @@ -42,16 +42,23 @@ #ifndef QMLTIMELINE_H #define QMLTIMELINE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QObject> #include <QtCore/QAbstractAnimation> #include <QtDeclarative/qfxglobal.h> -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE -QT_MODULE(Declarative) - class QEasingCurve; class QmlTimeLineValue; class QmlTimeLineEvent; @@ -183,8 +190,35 @@ private: QmlTimeLineObject *d2; }; -QT_END_NAMESPACE +template<class T> +class QmlTimeLineValueProxy : public QmlTimeLineValue +{ +public: + QmlTimeLineValueProxy(T *cls, void (T::*func)(qreal), qreal v = 0.) + : QmlTimeLineValue(v), _class(cls), _setFunctionReal(func), _setFunctionInt(0) + { + Q_ASSERT(_class); + } + + QmlTimeLineValueProxy(T *cls, void (T::*func)(int), qreal v = 0.) + : QmlTimeLineValue(v), _class(cls), _setFunctionReal(0), _setFunctionInt(func) + { + Q_ASSERT(_class); + } + + virtual void setValue(qreal v) + { + QmlTimeLineValue::setValue(v); + if (_setFunctionReal) (_class->*_setFunctionReal)(v); + else if (_setFunctionInt) (_class->*_setFunctionInt)((int)v); + } -QT_END_HEADER +private: + T *_class; + void (T::*_setFunctionReal)(qreal); + void (T::*_setFunctionInt)(int); +}; + +QT_END_NAMESPACE #endif diff --git a/src/declarative/util/qperformancelog.cpp b/src/declarative/util/qperformancelog.cpp index 932e4b3..8e11997 100644 --- a/src/declarative/util/qperformancelog.cpp +++ b/src/declarative/util/qperformancelog.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qperformancelog.h" +#include "qperformancelog_p.h" #include <QHash> #include <QDebug> diff --git a/src/declarative/util/qperformancelog.h b/src/declarative/util/qperformancelog_p.h index 6655a8d..6655a8d 100644 --- a/src/declarative/util/qperformancelog.h +++ b/src/declarative/util/qperformancelog_p.h diff --git a/src/declarative/util/util.pri b/src/declarative/util/util.pri index 0619a47..aae10af 100644 --- a/src/declarative/util/util.pri +++ b/src/declarative/util/util.pri @@ -17,13 +17,14 @@ SOURCES += \ util/qmllistmodel.cpp\ util/qmllistaccessor.cpp \ util/qmlopenmetaobject.cpp \ + util/qmltimeline.cpp \ util/qmlbind.cpp HEADERS += \ util/qfxview.h \ - util/qfxperf.h \ + util/qfxperf_p.h \ util/qfxglobal.h \ - util/qperformancelog.h \ + util/qperformancelog_p.h \ util/qmlconnection.h \ util/qmlpackage.h \ util/qmlscript.h \ @@ -42,4 +43,5 @@ HEADERS += \ util/qmllistaccessor.h \ util/qmlopenmetaobject.h \ util/qmlnullablevalue_p.h \ + util/qmltimeline_p.h \ util/qmlbind.h diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index cb7d00c..db0dc18 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -18,7 +18,7 @@ #include <QtDeclarative/qmlcontext.h> #include <QtDeclarative/qmlengine.h> #include "qml.h" -#include "qperformancelog.h" +#include <private/qperformancelog_p.h> #include "qfxtestengine.h" #include "deviceskin.h" |