summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-04-24 01:00:59 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-04-24 01:00:59 (GMT)
commit67185a8643c1a27cd30a660105333ea36605fba9 (patch)
tree86a1f14720968a8139dbe647467a82941a5f855c /src/declarative
parentc0979cc534e9204edc04759b7b6bef7d6980c466 (diff)
parentdb815819dae525c64575de38b92afa4cf092ce06 (diff)
downloadQt-67185a8643c1a27cd30a660105333ea36605fba9.zip
Qt-67185a8643c1a27cd30a660105333ea36605fba9.tar.gz
Qt-67185a8643c1a27cd30a660105333ea36605fba9.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/canvas/qsimplecanvasitem.cpp18
-rw-r--r--src/declarative/fx/qfxblendedimage.cpp2
-rw-r--r--src/declarative/fx/qfxitem.cpp8
-rw-r--r--src/declarative/fx/qfxwebview.cpp14
-rw-r--r--src/declarative/qml/qmlcomponent.cpp8
-rw-r--r--src/declarative/qml/qmlcomponent.h2
-rw-r--r--src/declarative/timeline/gfxeasing.cpp217
-rw-r--r--src/declarative/util/qfxview.cpp4
-rw-r--r--src/declarative/util/qmlanimation.cpp91
9 files changed, 122 insertions, 242 deletions
diff --git a/src/declarative/canvas/qsimplecanvasitem.cpp b/src/declarative/canvas/qsimplecanvasitem.cpp
index 3d3bf84..5e4b5fa 100644
--- a/src/declarative/canvas/qsimplecanvasitem.cpp
+++ b/src/declarative/canvas/qsimplecanvasitem.cpp
@@ -238,15 +238,15 @@ QPointF QSimpleCanvasItem::scenePos() const
Controls the point about which simple transforms like scale apply.
- \o TopLeft The top-left corner of the item.
- \o TopCenter The center point of the top of the item.
- \o TopRight The top-right corner of the item.
- \o MiddleLeft The left most point of the vertical middle.
- \o Center The center of the item.
- \o MiddleRight The right most point of the vertical middle.
- \o BottomLeft The bottom-left corner of the item.
- \o BottomCenter The center point of the bottom of the item.
- \o BottomRight The bottom-right corner of the item.
+ \value TopLeft The top-left corner of the item.
+ \value TopCenter The center point of the top of the item.
+ \value TopRight The top-right corner of the item.
+ \value MiddleLeft The left most point of the vertical middle.
+ \value Center The center of the item.
+ \value MiddleRight The right most point of the vertical middle.
+ \value BottomLeft The bottom-left corner of the item.
+ \value BottomCenter The center point of the bottom of the item.
+ \value BottomRight The bottom-right corner of the item.
*/
/*!
diff --git a/src/declarative/fx/qfxblendedimage.cpp b/src/declarative/fx/qfxblendedimage.cpp
index 773018f..9a3bb72 100644
--- a/src/declarative/fx/qfxblendedimage.cpp
+++ b/src/declarative/fx/qfxblendedimage.cpp
@@ -97,7 +97,7 @@ void QFxBlendedImage::setPrimaryUrl(const QString &url)
}
/*!
- \property QFxBlendedImage::secondaryFile
+ \property QFxBlendedImage::secondaryUrl
\brief the URL of the second image to be displayed in this item.
*/
QString QFxBlendedImage::secondaryUrl() const
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp
index 9aa742d..ed65b84 100644
--- a/src/declarative/fx/qfxitem.cpp
+++ b/src/declarative/fx/qfxitem.cpp
@@ -320,7 +320,7 @@ void QFxContents::setItem(QFxItem *item)
*/
/*!
- \fn void QFxItem::keyPress()
+ \fn void QFxItem::keyPress(QObject *event)
This signal is emitted when a key is pressed.
@@ -335,7 +335,7 @@ void QFxContents::setItem(QFxItem *item)
*/
/*!
- \fn void QFxItem::keyRelease()
+ \fn void QFxItem::keyRelease(QObject *event)
This signal is emitted when a key is released.
@@ -783,7 +783,7 @@ void QFxItem::setQml(const QString &qml)
if(!d->_qmlcomp->isLoading())
qmlLoaded();
else
- QObject::connect(d->_qmlcomp, SIGNAL(statusChanged(Status)),
+ QObject::connect(d->_qmlcomp, SIGNAL(statusChanged(QmlComponent::Status)),
this, SLOT(qmlLoaded()));
}
}
@@ -1650,7 +1650,7 @@ void QFxItem::newChild(const QString &type)
if(!d->_qmlnewcomp.last()->isLoading())
qmlLoaded();
else
- connect(d->_qmlnewcomp.last(), SIGNAL(statusChanged(Status)),
+ connect(d->_qmlnewcomp.last(), SIGNAL(statusChanged(QmlComponent::Status)),
this, SLOT(qmlLoaded()));
}
diff --git a/src/declarative/fx/qfxwebview.cpp b/src/declarative/fx/qfxwebview.cpp
index 9a9ee70..a5d2ac3 100644
--- a/src/declarative/fx/qfxwebview.cpp
+++ b/src/declarative/fx/qfxwebview.cpp
@@ -243,7 +243,7 @@ void QFxWebView::componentComplete()
This property holds the progress of loading the current URL, from 0 to 1.
*/
/*!
- \property qreal QFxWebView::progress
+ \property QFxWebView::progress
\brief the progress of loading the current URL, from 0 to 1.
*/
qreal QFxWebView::progress() const
@@ -284,7 +284,7 @@ void QFxWebView::doLoadFinished(bool ok)
loading of the URL successfully starts.
*/
/*!
- \property QString QFxWebView::url
+ \property QFxWebView::url
\brief the URL to the page displayed in this item.
\sa urlChanged()
@@ -330,7 +330,7 @@ void QFxWebView::setUrl(const QString &n)
This property holds the ideal width for displaying the current URL.
*/
/*!
- \property int QFxWebView::idealWidth
+ \property QFxWebView::idealWidth
\brief the ideal width for displaying the current URL.
*/
int QFxWebView::idealWidth() const
@@ -353,7 +353,7 @@ void QFxWebView::setIdealWidth(int iw)
This property holds the ideal height for displaying the current URL.
*/
/*!
- \property int QFxWebView::idealHeight
+ \property QFxWebView::idealHeight
\brief the ideal height for displaying the current URL.
*/
int QFxWebView::idealHeight() const
@@ -376,7 +376,7 @@ void QFxWebView::setIdealHeight(int ih)
This property holds controls whether the item responds to mouse and key events.
*/
/*!
- \property bool QFxWebView::interactive
+ \property QFxWebView::interactive
\brief controls whether the item responds to mouse and key events.
*/
bool QFxWebView::interactive() const
@@ -398,7 +398,7 @@ void QFxWebView::setInteractive(bool i)
This property holds hints as to whether the item should be drawn anti-aliased.
*/
/*!
- \property bool QFxWebView::smooth
+ \property QFxWebView::smooth
\brief hints as to whether the item should be drawn anti-aliased.
*/
bool QFxWebView::smooth() const
@@ -466,7 +466,7 @@ void QFxWebView::paintPage(const QRect& r)
The cache will not be larger than the (unscaled) size of the WebView.
*/
/*!
- \property int QFxWebView::cacheSize
+ \property QFxWebView::cacheSize
\brief the maximum number of pixels of image cache to allow
The default is 0.1 megapixels.
diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp
index 0f60870..83d500c 100644
--- a/src/declarative/qml/qmlcomponent.cpp
+++ b/src/declarative/qml/qmlcomponent.cpp
@@ -96,10 +96,10 @@ QML_DEFINE_TYPE(QmlComponent,Component);
Specifies the loading status of the QmlComponent.
- \o Null This QmlComponent has no data. Call loadUrl() or setData() to add QML content.
- \o Ready This QmlComponent is ready and create() may be called.
- \o Loading This QmlComponent is loading network data.
- \o Error An error has occured. Calling errorDescription() to retrieve a description.
+ \value Null This QmlComponent has no data. Call loadUrl() or setData() to add QML content.
+ \value Ready This QmlComponent is ready and create() may be called.
+ \value Loading This QmlComponent is loading network data.
+ \value Error An error has occured. Calling errorDescription() to retrieve a description.
*/
void QmlComponentPrivate::typeDataReady()
diff --git a/src/declarative/qml/qmlcomponent.h b/src/declarative/qml/qmlcomponent.h
index 91e0917..83d08ea 100644
--- a/src/declarative/qml/qmlcomponent.h
+++ b/src/declarative/qml/qmlcomponent.h
@@ -89,7 +89,7 @@ public:
void setData(const QByteArray &, const QUrl &baseUrl = QUrl());
Q_SIGNALS:
- void statusChanged(Status);
+ void statusChanged(QmlComponent::Status);
protected:
QmlComponent(QmlComponentPrivate &dd, QObject* parent);
diff --git a/src/declarative/timeline/gfxeasing.cpp b/src/declarative/timeline/gfxeasing.cpp
index 59767b2..45b84eb 100644
--- a/src/declarative/timeline/gfxeasing.cpp
+++ b/src/declarative/timeline/gfxeasing.cpp
@@ -454,169 +454,134 @@ Q_GLOBAL_STATIC(ConfigFunctionMap, configFunctionMap);
\enum GfxEasing::Curve
The type of easing curve.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::None
+
+ \value None
Easing equation function for a simple linear tweening, with no easing.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InQuad
+
+ \value InQuad
Easing equation function for a quadratic (t^2) easing in: accelerating from zero velocity.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutQuad
+
+ \value OutQuad
Easing equation function for a quadratic (t^2) easing out: decelerating to zero velocity.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InOutQuad
+
+ \value InOutQuad
Easing equation function for a quadratic (t^2) easing in/out: acceleration until halfway, then deceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutInQuad
+
+ \value OutInQuad
Easing equation function for a quadratic (t^2) easing out/in: deceleration until halfway, then acceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InCubic
+
+ \value InCubic
Easing equation function for a cubic (t^3) easing in: accelerating from zero velocity.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutCubic
+
+ \value OutCubic
Easing equation function for a cubic (t^3) easing out: decelerating from zero velocity.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InOutCubic
+
+ \value InOutCubic
Easing equation function for a cubic (t^3) easing in/out: acceleration until halfway, then deceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutInCubic
+
+ \value OutInCubic
Easing equation function for a cubic (t^3) easing out/in: deceleration until halfway, then acceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InQuart
+
+ \value InQuart
Easing equation function for a quartic (t^4) easing in: accelerating from zero velocity.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutQuart
+
+ \value OutQuart
Easing equation function for a quartic (t^4) easing out: decelerating from zero velocity.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InOutQuart
+
+ \value InOutQuart
Easing equation function for a quartic (t^4) easing in/out: acceleration until halfway, then deceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutInQuart
+
+ \value OutInQuart
Easing equation function for a quartic (t^4) easing out/in: deceleration until halfway, then acceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InQuint
+
+ \value InQuint
Easing equation function for a quintic (t^5) easing in: accelerating from zero velocity.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutQuint
+
+ \value OutQuint
Easing equation function for a quintic (t^5) easing out: decelerating from zero velocity.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InOutQuint
+
+ \value InOutQuint
Easing equation function for a quintic (t^5) easing in/out: acceleration until halfway, then deceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutInQuint
+
+ \value OutInQuint
Easing equation function for a quintic (t^5) easing out/in: deceleration until halfway, then acceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InSine
+
+ \value InSine
Easing equation function for a sinusoidal (sin(t)) easing in: accelerating from zero velocity.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutSine
+
+ \value OutSine
Easing equation function for a sinusoidal (sin(t)) easing out: decelerating from zero velocity.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InOutSine
+
+ \value InOutSine
Easing equation function for a sinusoidal (sin(t)) easing in/out: acceleration until halfway, then deceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutInSine
+
+ \value OutInSine
Easing equation function for a sinusoidal (sin(t)) easing out/in: deceleration until halfway, then acceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InExpo
+
+ \value InExpo
Easing equation function for an exponential (2^t) easing in: accelerating from zero velocity.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutExpo
+
+ \value OutExpo
Easing equation function for an exponential (2^t) easing out: decelerating from zero velocity.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InOutExpo
+
+ \value InOutExpo
Easing equation function for an exponential (2^t) easing in/out: acceleration until halfway, then deceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutInExpo
+
+ \value OutInExpo
Easing equation function for an exponential (2^t) easing out/in: deceleration until halfway, then acceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InCirc
+
+ \value InCirc
Easing equation function for a circular (sqrt(1-t^2)) easing in: accelerating from zero velocity.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutCirc
+
+ \value OutCirc
Easing equation function for a circular (sqrt(1-t^2)) easing out: decelerating from zero velocity.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InOutCirc
+
+ \value InOutCirc
Easing equation function for a circular (sqrt(1-t^2)) easing in/out: acceleration until halfway, then deceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutInCirc
+
+ \value OutInCirc
Easing equation function for a circular (sqrt(1-t^2)) easing out/in: deceleration until halfway, then acceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InElastic
- Easing equation function for an elastic (exponentially decaying sine wave) easing in: accelerating from zero velocity. The peak amplitude can be set with the \i amplitude parameter, and the period of decay by the \i period parameter.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutElastic
- Easing equation function for an elastic (exponentially decaying sine wave) easing out: decelerating from zero velocity. The peak amplitude can be set with the \i amplitude parameter, and the period of decay by the \i period parameter.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InOutElastic
+
+ \value InElastic
+ Easing equation function for an elastic (exponentially decaying
+ sine wave) easing in: accelerating from zero velocity. The peak
+ amplitude can be set with the \e amplitude parameter, and the
+ period of decay by the \e period parameter.
+
+ \value OutElastic
+ Easing equation function for an elastic (exponentially decaying
+ sine wave) easing out: decelerating from zero velocity. The peak
+ amplitude can be set with the \e amplitude parameter, and the
+ period of decay by the \e period parameter.
+
+ \value InOutElastic
Easing equation function for an elastic (exponentially decaying sine wave) easing in/out: acceleration until halfway, then deceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutInElastic
+
+ \value OutInElastic
Easing equation function for an elastic (exponentially decaying sine wave) easing out/in: deceleration until halfway, then acceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InBack
+
+ \value InBack
Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing in: accelerating from zero velocity.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutBack
+
+ \value OutBack
Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out: decelerating from zero velocity.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InOutBack
+
+ \value InOutBack
Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing in/out: acceleration until halfway, then deceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutInBack
+
+ \value OutInBack
Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out/in: deceleration until halfway, then acceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutBounce
+
+ \value OutBounce
Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out: decelerating from zero velocity.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InBounce
+
+ \value InBounce
Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in: accelerating from zero velocity.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::InOutBounce
+
+ \value InOutBounce
Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in/out: acceleration until halfway, then deceleration.
-*/
-/*!
- \var GfxEasing::Curve GfxEasing::OutInBounce
+
+ \value OutInBounce
Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out/in: deceleration until halfway, then acceleration.
*/
@@ -647,7 +612,7 @@ GfxEasing::GfxEasing(Curve curve)
Curve names have the form
\c {ease<CurveName>[(<arg>: <arg value>[, <arg2>: <arg value>])]}. The
- \i CurveName is equivalent to the GfxEasing::Curve enum name. Some more
+ \e CurveName is equivalent to the GfxEasing::Curve enum name. Some more
advanced curves can take arguments to further refine their behaviour. Where
applicable, these parameters are described in the corresponding
GfxEasing::Curve value documentation.
diff --git a/src/declarative/util/qfxview.cpp b/src/declarative/util/qfxview.cpp
index 4aa0932..a8b8eea 100644
--- a/src/declarative/util/qfxview.cpp
+++ b/src/declarative/util/qfxview.cpp
@@ -203,13 +203,13 @@ void QFxView::execute()
if(!d->component->isLoading()) {
continueExecute();
} else {
- connect(d->component, SIGNAL(statusChanged(Status)), this, SLOT(continueExecute()));
+ connect(d->component, SIGNAL(statusChanged(QmlComponent::Status)), this, SLOT(continueExecute()));
}
}
void QFxView::continueExecute()
{
- disconnect(d->component, SIGNAL(statusChanged(Status)), this, SLOT(continueExecute()));
+ disconnect(d->component, SIGNAL(statusChanged(QmlComponent::Status)), this, SLOT(continueExecute()));
if(!d->component){
qWarning() << "Error in loading" << d->source;
diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp
index de6d84c..ede4008 100644
--- a/src/declarative/util/qmlanimation.cpp
+++ b/src/declarative/util/qmlanimation.cpp
@@ -55,6 +55,7 @@
#include <QtCore/qset.h>
#include <QtDeclarative/qmlexpression.h>
#include <private/qmlstringconverters_p.h>
+#include <private/qvariantanimation_p.h>
/* TODO:
Check for any memory leaks
@@ -1823,99 +1824,13 @@ void QmlParallelAnimation::transition(QmlStateActions &actions,
QML_DEFINE_TYPE(QmlParallelAnimation,ParallelAnimation);
-//XXX it would be good to use QVariantAnimation's interpolators if possible
QVariant QmlVariantAnimationPrivate::interpolateVariant(const QVariant &from, const QVariant &to, qreal progress)
{
if (from.userType() != to.userType())
return QVariant();
- QVariant res;
- switch (from.userType()) {
- case QVariant::Int: {
- int f = from.toInt();
- int t = to.toInt();
- res = f + (t - f) * progress;
- break;
- }
- case QVariant::Double: {
- double f = from.toDouble();
- double t = to.toDouble();
- res = f + (t - f) * progress;
- break;
- }
- case QMetaType::Float: {
- float f = from.toDouble();
- float t = to.toDouble();
- res = f + (t - f) * progress;
- break;
- }
- case QVariant::Color: {
- QColor f = from.value<QColor>();
- QColor t = to.value<QColor>();
- uint red = uint(qreal(f.red()) + progress * (qreal(t.red()) - qreal(f.red())));
- uint green = uint(qreal(f.green()) + progress * (qreal(t.green()) - qreal(f.green())));
- uint blue = uint(qreal(f.blue()) + progress * (qreal(t.blue()) - qreal(f.blue())));
- res = QColor(red,green,blue);
- break;
- }
- case QVariant::Rect: {
- QRect f = from.value<QRect>();
- QRect t = to.value<QRect>();
- int x = f.x() + (t.x() - f.x()) * progress;
- int y = f.y() + (t.y() - f.y()) * progress;
- int w = f.width() + (t.width() - f.width()) * progress;
- int h = f.height() + (t.height() - f.height()) * progress;
- res = QRect(x, y, w, h);
- break;
- }
- case QVariant::RectF: {
- QRectF f = from.value<QRectF>();
- QRectF t = to.value<QRectF>();
- qreal x = f.x() + (t.x() - f.x()) * progress;
- qreal y = f.y() + (t.y() - f.y()) * progress;
- qreal w = f.width() + (t.width() - f.width()) * progress;
- qreal h = f.height() + (t.height() - f.height()) * progress;
- res = QRectF(x, y, w, h);
- break;
- }
- case QVariant::Point: {
- QPoint f = from.value<QPoint>();
- QPoint t = to.value<QPoint>();
- int x = f.x() + (t.x() - f.x()) * progress;
- int y = f.y() + (t.y() - f.y()) * progress;
- res = QPointF(x, y);
- break;
- }
- case QVariant::PointF: {
- QPointF f = from.value<QPointF>();
- QPointF t = to.value<QPointF>();
- qreal x = f.x() + (t.x() - f.x()) * progress;
- qreal y = f.y() + (t.y() - f.y()) * progress;
- res = QPointF(x, y);
- break;
- }
- case QVariant::Size: {
- QSize f = from.value<QSize>();
- QSize t = to.value<QSize>();
- int w = f.width() + (t.width() - f.width()) * progress;
- int h = f.height() + (t.height() - f.height()) * progress;
- res = QSize(w, h);
- break;
- }
- case QVariant::SizeF: {
- QSizeF f = from.value<QSizeF>();
- QSizeF t = to.value<QSizeF>();
- qreal w = f.width() + (t.width() - f.width()) * progress;
- qreal h = f.height() + (t.height() - f.height()) * progress;
- res = QSizeF(w, h);
- break;
- }
- default:
- res = to;
- break;
- }
-
- return res;
+ QVariantAnimation::Interpolator interpolator = QVariantAnimationPrivate::getInterpolator(from.userType());
+ return interpolator(from.constData(), to.constData(), progress);
}
//convert a variant from string type to another animatable type