From c8503d44bce2e038a5e2ba7597878dbcfcced4cb Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 27 Aug 2009 11:31:19 +1000 Subject: Rename Behavior cpp class to match the QML name. --- src/declarative/debugger/qpacketprotocol.cpp | 2 +- src/declarative/extra/extra.pri | 4 +- src/declarative/extra/qmlbehavior.cpp | 236 +++++++++++++++++++++++++++ src/declarative/extra/qmlbehavior.h | 91 +++++++++++ src/declarative/extra/qmlbehaviour.cpp | 236 --------------------------- src/declarative/extra/qmlbehaviour.h | 91 ----------- src/declarative/fx/qfxflickable.h | 2 +- src/declarative/fx/qfxtextinput.cpp | 14 ++ src/declarative/qml/qmlcompiler.cpp | 2 +- src/declarative/util/qmlanimation.cpp | 14 +- 10 files changed, 353 insertions(+), 339 deletions(-) create mode 100644 src/declarative/extra/qmlbehavior.cpp create mode 100644 src/declarative/extra/qmlbehavior.h delete mode 100644 src/declarative/extra/qmlbehaviour.cpp delete mode 100644 src/declarative/extra/qmlbehaviour.h diff --git a/src/declarative/debugger/qpacketprotocol.cpp b/src/declarative/debugger/qpacketprotocol.cpp index 6bccf4b..84882dd 100644 --- a/src/declarative/debugger/qpacketprotocol.cpp +++ b/src/declarative/debugger/qpacketprotocol.cpp @@ -391,7 +391,7 @@ QIODevice * QPacketProtocol::device() Only packets returned from QPacketProtocol::read() may be read from. QPacket instances constructed by directly by applications are for transmission only and are considered "write only". Attempting to read data from them will - result in undefined behaviour. + result in undefined behavior. \ingroup io \sa QPacketProtocol diff --git a/src/declarative/extra/extra.pri b/src/declarative/extra/extra.pri index 1f84406..ae07a19 100644 --- a/src/declarative/extra/extra.pri +++ b/src/declarative/extra/extra.pri @@ -7,7 +7,7 @@ SOURCES += \ extra/qfxanimatedimageitem.cpp \ extra/qfxflowview.cpp \ extra/qfxparticles.cpp \ - extra/qmlbehaviour.cpp \ + extra/qmlbehavior.cpp \ extra/qbindablemap.cpp \ extra/qmlfontloader.cpp @@ -21,7 +21,7 @@ HEADERS += \ extra/qfxanimatedimageitem_p.h \ extra/qfxflowview.h \ extra/qfxparticles.h \ - extra/qmlbehaviour.h \ + extra/qmlbehavior.h \ extra/qbindablemap.h \ extra/qmlfontloader.h diff --git a/src/declarative/extra/qmlbehavior.cpp b/src/declarative/extra/qmlbehavior.cpp new file mode 100644 index 0000000..b40024e --- /dev/null +++ b/src/declarative/extra/qmlbehavior.cpp @@ -0,0 +1,236 @@ +/**************************************************************************** +** +** 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$ +** +****************************************************************************/ + +#include +#include "qmlanimation.h" +#include "qmltransition.h" +#include "qmlbehavior.h" +#include +#include + +QT_BEGIN_NAMESPACE + +QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Behavior,QmlBehavior) + +class QmlBehaviorData : public QObject +{ +Q_OBJECT +public: + QmlBehaviorData(QObject *parent) + : QObject(parent) {} + + Q_PROPERTY(QVariant endValue READ endValue NOTIFY valuesChanged) + Q_PROPERTY(QVariant startValue READ startValue NOTIFY valuesChanged) + QVariant endValue() const { return e; } + QVariant startValue() const { return s; } + + QVariant e; + QVariant s; + +Q_SIGNALS: + void valuesChanged(); + +private: + friend class QmlBehavior; +}; + +class QmlBehaviorPrivate : public QObjectPrivate +{ +public: + QmlBehaviorPrivate() : operations(this) {} + QmlMetaProperty property; + QVariant currentValue; + + QVariant fromValue; + QVariant toValue; + class AnimationList : public QmlConcreteList + { + public: + AnimationList(QmlBehaviorPrivate *parent) : _parent(parent) {} + virtual void append(QmlAbstractAnimation *a) + { + QmlConcreteList::append(a); + _parent->group->addAnimation(a->qtAnimation()); + if (_parent->property.isValid()) { + a->setTarget(_parent->property); + } + } + virtual void clear() { QmlConcreteList::clear(); } //### + private: + QmlBehaviorPrivate *_parent; + }; + AnimationList operations; + QParallelAnimationGroup *group; +}; + +/*! + \qmlclass Behavior QmlBehavior + \brief The Behavior element allows you to specify a default animation for a property change. + + In example below, the rect will use a bounce easing curve over 200 millisecond for any changes to its y property: + \code + Rectangle { + width: 20; height: 20 + color: "#00ff00" + y: 200 //initial value + y: Behavior { + NumberAnimation { + easing: "easeOutBounce(amplitude:100)" + duration: 200 + } + } + } + \endcode +*/ + +QmlBehavior::QmlBehavior(QObject *parent) +: QmlPropertyValueSource(*(new QmlBehaviorPrivate), parent) +{ + Q_D(QmlBehavior); + d->group = new QParallelAnimationGroup; + QFx_setParent_noEvent(d->group, this); +} + +/*! + \qmlproperty QVariant Behavior::from + This property holds a selector specifying a starting value for the behavior. + + If you only want the behavior to apply when the change starts at a + specific value you can specify fromValue. This selector is used in conjunction + with the to selector. +*/ + +QVariant QmlBehavior::fromValue() const +{ + Q_D(const QmlBehavior); + return d->fromValue; +} + +void QmlBehavior::setFromValue(const QVariant &v) +{ + Q_D(QmlBehavior); + d->fromValue = v; +} + +/*! + \qmlproperty QVariant Behavior::to + This property holds a selector specifying a ending value for the behavior. + + If you only want the behavior to apply when the change ends at a + specific value you can specify toValue. This selector is used in conjunction + with the from selector. +*/ + +QVariant QmlBehavior::toValue() const +{ + Q_D(const QmlBehavior); + return d->toValue; +} + +void QmlBehavior::setToValue(const QVariant &v) +{ + Q_D(QmlBehavior); + d->toValue = v; +} + +QmlList* QmlBehavior::operations() +{ + Q_D(QmlBehavior); + return &d->operations; +} + +QmlBehavior::~QmlBehavior() +{ + //### do we need any other cleanup here? +} + +bool QmlBehavior::_ignore = false; +void QmlBehavior::propertyValueChanged() +{ + Q_D(QmlBehavior); + if (_ignore) + return; + + QVariant newValue = d->property.read(); + + if ((!fromValue().isValid() || fromValue() == d->currentValue) && + (!toValue().isValid() || toValue() == newValue)) { + + //### does this clean up everything needed? + d->group->stop(); + + QmlStateOperation::ActionList actions; + Action action; + action.property = d->property; + action.fromValue = d->currentValue; + action.toValue = newValue; + actions << action; + + _ignore = true; + d->property.write(d->currentValue); + + QList after; + for (int ii = 0; ii < d->operations.count(); ++ii) { + d->operations.at(ii)->transition(actions, after, QmlAbstractAnimation::Forward); + } + d->group->start(); + if (!after.contains(d->property)) + d->property.write(newValue); + _ignore = false; + } + + d->currentValue = newValue; +} + +void QmlBehavior::setTarget(const QmlMetaProperty &property) +{ + Q_D(QmlBehavior); + d->property = property; + d->currentValue = property.read(); + d->property.connectNotifier(this, SLOT(propertyValueChanged())); + for (int ii = 0; ii < d->operations.count(); ++ii) { + d->operations.at(ii)->setTarget(property); + } +} + +QT_END_NAMESPACE + +#include "qmlbehavior.moc" diff --git a/src/declarative/extra/qmlbehavior.h b/src/declarative/extra/qmlbehavior.h new file mode 100644 index 0000000..1be00c9 --- /dev/null +++ b/src/declarative/extra/qmlbehavior.h @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** 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 QMLBEHAVIOR_H +#define QMLBEHAVIOR_H + +#include +#include +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlAbstractAnimation; +class QmlBehaviorPrivate; +class Q_DECLARATIVE_EXPORT QmlBehavior : public QmlPropertyValueSource +{ + Q_OBJECT + Q_DECLARE_PRIVATE(QmlBehavior) + + Q_PROPERTY(QVariant from READ fromValue WRITE setFromValue) + Q_PROPERTY(QVariant to READ toValue WRITE setToValue) + Q_CLASSINFO("DefaultProperty", "operations") + Q_PROPERTY(QmlList* operations READ operations) + +public: + QmlBehavior(QObject *parent=0); + ~QmlBehavior(); + + QVariant fromValue() const; + void setFromValue(const QVariant &); + QVariant toValue() const; + void setToValue(const QVariant &); + virtual void setTarget(const QmlMetaProperty &); + + QmlList* operations(); + + static bool _ignore; + +private Q_SLOTS: + void propertyValueChanged(); +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlBehavior) + +QT_END_HEADER + +#endif // QMLBEHAVIOR_H diff --git a/src/declarative/extra/qmlbehaviour.cpp b/src/declarative/extra/qmlbehaviour.cpp deleted file mode 100644 index 767f1ed..0000000 --- a/src/declarative/extra/qmlbehaviour.cpp +++ /dev/null @@ -1,236 +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$ -** -****************************************************************************/ - -#include -#include "qmlanimation.h" -#include "qmltransition.h" -#include "qmlbehaviour.h" -#include -#include - -QT_BEGIN_NAMESPACE - -QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Behavior,QmlBehaviour) - -class QmlBehaviourData : public QObject -{ -Q_OBJECT -public: - QmlBehaviourData(QObject *parent) - : QObject(parent) {} - - Q_PROPERTY(QVariant endValue READ endValue NOTIFY valuesChanged) - Q_PROPERTY(QVariant startValue READ startValue NOTIFY valuesChanged) - QVariant endValue() const { return e; } - QVariant startValue() const { return s; } - - QVariant e; - QVariant s; - -Q_SIGNALS: - void valuesChanged(); - -private: - friend class QmlBehaviour; -}; - -class QmlBehaviourPrivate : public QObjectPrivate -{ -public: - QmlBehaviourPrivate() : operations(this) {} - QmlMetaProperty property; - QVariant currentValue; - - QVariant fromValue; - QVariant toValue; - class AnimationList : public QmlConcreteList - { - public: - AnimationList(QmlBehaviourPrivate *parent) : _parent(parent) {} - virtual void append(QmlAbstractAnimation *a) - { - QmlConcreteList::append(a); - _parent->group->addAnimation(a->qtAnimation()); - if (_parent->property.isValid()) { - a->setTarget(_parent->property); - } - } - virtual void clear() { QmlConcreteList::clear(); } //### - private: - QmlBehaviourPrivate *_parent; - }; - AnimationList operations; - QParallelAnimationGroup *group; -}; - -/*! - \qmlclass Behavior QmlBehaviour - \brief The Behavior element allows you to specify a default animation for a property change. - - In example below, the rect will use a bounce easing curve over 200 millisecond for any changes to its y property: - \code - Rectangle { - width: 20; height: 20 - color: "#00ff00" - y: 200 //initial value - y: Behavior { - NumberAnimation { - easing: "easeOutBounce(amplitude:100)" - duration: 200 - } - } - } - \endcode -*/ - -QmlBehaviour::QmlBehaviour(QObject *parent) -: QmlPropertyValueSource(*(new QmlBehaviourPrivate), parent) -{ - Q_D(QmlBehaviour); - d->group = new QParallelAnimationGroup; - QFx_setParent_noEvent(d->group, this); -} - -/*! - \qmlproperty QVariant Behavior::fromValue - This property holds a selector specifying a starting value for the behavior - - If you only want the behavior to apply when the change starts at a - specific value you can specify fromValue. This selector is used in conjunction - with the toValue selector. -*/ - -QVariant QmlBehaviour::fromValue() const -{ - Q_D(const QmlBehaviour); - return d->fromValue; -} - -void QmlBehaviour::setFromValue(const QVariant &v) -{ - Q_D(QmlBehaviour); - d->fromValue = v; -} - -/*! - \qmlproperty QVariant Behavior::toValue - This property holds a selector specifying a ending value for the behavior - - If you only want the behavior to apply when the change ends at a - specific value you can specify toValue. This selector is used in conjunction - with the fromValue selector. -*/ - -QVariant QmlBehaviour::toValue() const -{ - Q_D(const QmlBehaviour); - return d->toValue; -} - -void QmlBehaviour::setToValue(const QVariant &v) -{ - Q_D(QmlBehaviour); - d->toValue = v; -} - -QmlList* QmlBehaviour::operations() -{ - Q_D(QmlBehaviour); - return &d->operations; -} - -QmlBehaviour::~QmlBehaviour() -{ - //### do we need any other cleanup here? -} - -bool QmlBehaviour::_ignore = false; -void QmlBehaviour::propertyValueChanged() -{ - Q_D(QmlBehaviour); - if (_ignore) - return; - - QVariant newValue = d->property.read(); - - if ((!fromValue().isValid() || fromValue() == d->currentValue) && - (!toValue().isValid() || toValue() == newValue)) { - - //### does this clean up everything needed? - d->group->stop(); - - QmlStateOperation::ActionList actions; - Action action; - action.property = d->property; - action.fromValue = d->currentValue; - action.toValue = newValue; - actions << action; - - _ignore = true; - d->property.write(d->currentValue); - - QList after; - for (int ii = 0; ii < d->operations.count(); ++ii) { - d->operations.at(ii)->transition(actions, after, QmlAbstractAnimation::Forward); - } - d->group->start(); - if (!after.contains(d->property)) - d->property.write(newValue); - _ignore = false; - } - - d->currentValue = newValue; -} - -void QmlBehaviour::setTarget(const QmlMetaProperty &property) -{ - Q_D(QmlBehaviour); - d->property = property; - d->currentValue = property.read(); - d->property.connectNotifier(this, SLOT(propertyValueChanged())); - for (int ii = 0; ii < d->operations.count(); ++ii) { - d->operations.at(ii)->setTarget(property); - } -} - -QT_END_NAMESPACE - -#include "qmlbehaviour.moc" diff --git a/src/declarative/extra/qmlbehaviour.h b/src/declarative/extra/qmlbehaviour.h deleted file mode 100644 index 99fc779..0000000 --- a/src/declarative/extra/qmlbehaviour.h +++ /dev/null @@ -1,91 +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 QMLBEHAVIOUR_H -#define QMLBEHAVIOUR_H - -#include -#include -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlAbstractAnimation; -class QmlBehaviourPrivate; -class Q_DECLARATIVE_EXPORT QmlBehaviour : public QmlPropertyValueSource -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QmlBehaviour) - - Q_PROPERTY(QVariant from READ fromValue WRITE setFromValue) - Q_PROPERTY(QVariant to READ toValue WRITE setToValue) - Q_CLASSINFO("DefaultProperty", "operations") - Q_PROPERTY(QmlList* operations READ operations) - -public: - QmlBehaviour(QObject *parent=0); - ~QmlBehaviour(); - - QVariant fromValue() const; - void setFromValue(const QVariant &); - QVariant toValue() const; - void setToValue(const QVariant &); - virtual void setTarget(const QmlMetaProperty &); - - QmlList* operations(); - - static bool _ignore; - -private Q_SLOTS: - void propertyValueChanged(); -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlBehaviour) - -QT_END_HEADER - -#endif // QMLBEHAVIOUR_H diff --git a/src/declarative/fx/qfxflickable.h b/src/declarative/fx/qfxflickable.h index e13fa9b..13d793f 100644 --- a/src/declarative/fx/qfxflickable.h +++ b/src/declarative/fx/qfxflickable.h @@ -70,7 +70,7 @@ class Q_DECLARATIVE_EXPORT QFxFlickable : public QFxItem Q_PROPERTY(bool flicking READ isFlicking NOTIFY flickingChanged) Q_PROPERTY(bool locked READ isLocked WRITE setLocked) //### interactive, ensure flicking is stopped, etc. - Q_PROPERTY(DragMode dragMode READ dragMode WRITE setDragMode) //### remove. Consider a better way to implement different drag behaviour + Q_PROPERTY(DragMode dragMode READ dragMode WRITE setDragMode) //### remove. Consider a better way to implement different drag behavior Q_PROPERTY(bool atXEnd READ isAtXEnd NOTIFY isAtBoundaryChanged) Q_PROPERTY(bool atYEnd READ isAtYEnd NOTIFY isAtBoundaryChanged) diff --git a/src/declarative/fx/qfxtextinput.cpp b/src/declarative/fx/qfxtextinput.cpp index b9b33ab..f491d34 100644 --- a/src/declarative/fx/qfxtextinput.cpp +++ b/src/declarative/fx/qfxtextinput.cpp @@ -320,6 +320,20 @@ void QFxTextInput::setSelectionEnd(int s) d->control->setSelection(d->lastSelectionStart, s - d->lastSelectionStart); } +/*! + \qmlproperty string TextInput::selectedText + + This read-only property provides the text currently selected in the + text input. + + It is equivalent to the following snippet, but is faster and easier + to use. + + \qmlcode + myTextInput.text.toString().substring(myTextInput.selectionStart, + myTextInput.selectionEnd); + \endcode +*/ QString QFxTextInput::selectedText() const { Q_D(const QFxTextInput); diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index 4f96d12..b5edc38 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -1231,7 +1231,7 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop, if (!prop->isDefault && prop->name == "id" && !ctxt.isSubContext()) { - // The magic "id" behaviour doesn't apply when "id" is resolved as a + // The magic "id" behavior doesn't apply when "id" is resolved as a // default property or to sub-objects (which are always in binding // sub-contexts) COMPILE_CHECK(buildIdProperty(prop, obj)); diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp index 89b5660..cbf4114 100644 --- a/src/declarative/util/qmlanimation.cpp +++ b/src/declarative/util/qmlanimation.cpp @@ -47,7 +47,7 @@ #include "qml.h" #include "qmlinfo.h" #include "qmlanimation_p.h" -#include "qmlbehaviour.h" +#include "qmlbehavior.h" #include #include #include @@ -330,7 +330,7 @@ void QmlAbstractAnimation::componentComplete() calling the \c stop() method. The \c complete() method is not effected by this value. - This behaviour is most useful when the \c repeat property is set, as the + This behavior is most useful when the \c repeat property is set, as the animation will finish playing normally but not restart. By default, the alwaysRunToEnd property is not set. @@ -1007,9 +1007,9 @@ void QmlPropertyAction::transition(QmlStateActions &actions, { for (int ii = 0; ii < actions.count(); ++ii) { const Action &action = actions.at(ii); - QmlBehaviour::_ignore = true; + QmlBehavior::_ignore = true; action.property.write(action.toValue); - QmlBehaviour::_ignore = false; + QmlBehavior::_ignore = false; } } }; @@ -1338,7 +1338,7 @@ void QmlSequentialAnimation::transition(QmlStateActions &actions, inc = -1; from = d->animations.count() - 1; } - + //needed for Behavior if (d->userProperty.isValid() && d->propertyName.isEmpty() && !target()) { for (int i = 0; i < d->animations.count(); ++i) @@ -1760,7 +1760,7 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions, for (int ii = 0; ii < actions.count(); ++ii) { Action &action = actions[ii]; - QmlBehaviour::_ignore = true; + QmlBehavior::_ignore = true; if (v == 1.) action.property.write(action.toValue); else { @@ -1779,7 +1779,7 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions, if (interpolator) action.property.write(interpolator(action.fromValue.constData(), action.toValue.constData(), v)); } - QmlBehaviour::_ignore = false; + QmlBehavior::_ignore = false; } } }; -- cgit v0.12