diff options
-rw-r--r-- | src/declarative/debugger/qpacketprotocol.cpp | 2 | ||||
-rw-r--r-- | src/declarative/extra/extra.pri | 4 | ||||
-rw-r--r-- | src/declarative/extra/qmlbehavior.cpp (renamed from src/declarative/extra/qmlbehaviour.cpp) | 74 | ||||
-rw-r--r-- | src/declarative/extra/qmlbehavior.h (renamed from src/declarative/extra/qmlbehaviour.h) | 18 | ||||
-rw-r--r-- | src/declarative/fx/qfxflickable.h | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfxtextinput.cpp | 14 | ||||
-rw-r--r-- | src/declarative/qml/qmlcompiler.cpp | 2 | ||||
-rw-r--r-- | src/declarative/util/qmlanimation.cpp | 14 |
8 files changed, 72 insertions, 58 deletions
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/qmlbehaviour.cpp b/src/declarative/extra/qmlbehavior.cpp index 767f1ed..b40024e 100644 --- a/src/declarative/extra/qmlbehaviour.cpp +++ b/src/declarative/extra/qmlbehavior.cpp @@ -42,19 +42,19 @@ #include <private/qobject_p.h> #include "qmlanimation.h" #include "qmltransition.h" -#include "qmlbehaviour.h" +#include "qmlbehavior.h" #include <QtDeclarative/qmlcontext.h> #include <QtCore/qparallelanimationgroup.h> QT_BEGIN_NAMESPACE -QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Behavior,QmlBehaviour) +QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Behavior,QmlBehavior) -class QmlBehaviourData : public QObject +class QmlBehaviorData : public QObject { Q_OBJECT public: - QmlBehaviourData(QObject *parent) + QmlBehaviorData(QObject *parent) : QObject(parent) {} Q_PROPERTY(QVariant endValue READ endValue NOTIFY valuesChanged) @@ -69,13 +69,13 @@ Q_SIGNALS: void valuesChanged(); private: - friend class QmlBehaviour; + friend class QmlBehavior; }; -class QmlBehaviourPrivate : public QObjectPrivate +class QmlBehaviorPrivate : public QObjectPrivate { public: - QmlBehaviourPrivate() : operations(this) {} + QmlBehaviorPrivate() : operations(this) {} QmlMetaProperty property; QVariant currentValue; @@ -84,7 +84,7 @@ public: class AnimationList : public QmlConcreteList<QmlAbstractAnimation *> { public: - AnimationList(QmlBehaviourPrivate *parent) : _parent(parent) {} + AnimationList(QmlBehaviorPrivate *parent) : _parent(parent) {} virtual void append(QmlAbstractAnimation *a) { QmlConcreteList<QmlAbstractAnimation *>::append(a); @@ -95,14 +95,14 @@ public: } virtual void clear() { QmlConcreteList<QmlAbstractAnimation *>::clear(); } //### private: - QmlBehaviourPrivate *_parent; + QmlBehaviorPrivate *_parent; }; AnimationList operations; QParallelAnimationGroup *group; }; /*! - \qmlclass Behavior QmlBehaviour + \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: @@ -121,77 +121,77 @@ public: \endcode */ -QmlBehaviour::QmlBehaviour(QObject *parent) -: QmlPropertyValueSource(*(new QmlBehaviourPrivate), parent) +QmlBehavior::QmlBehavior(QObject *parent) +: QmlPropertyValueSource(*(new QmlBehaviorPrivate), parent) { - Q_D(QmlBehaviour); + Q_D(QmlBehavior); 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 + \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 toValue selector. + with the to selector. */ -QVariant QmlBehaviour::fromValue() const +QVariant QmlBehavior::fromValue() const { - Q_D(const QmlBehaviour); + Q_D(const QmlBehavior); return d->fromValue; } -void QmlBehaviour::setFromValue(const QVariant &v) +void QmlBehavior::setFromValue(const QVariant &v) { - Q_D(QmlBehaviour); + Q_D(QmlBehavior); d->fromValue = v; } /*! - \qmlproperty QVariant Behavior::toValue - This property holds a selector specifying a ending value for the behavior + \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 fromValue selector. + with the from selector. */ -QVariant QmlBehaviour::toValue() const +QVariant QmlBehavior::toValue() const { - Q_D(const QmlBehaviour); + Q_D(const QmlBehavior); return d->toValue; } -void QmlBehaviour::setToValue(const QVariant &v) +void QmlBehavior::setToValue(const QVariant &v) { - Q_D(QmlBehaviour); + Q_D(QmlBehavior); d->toValue = v; } -QmlList<QmlAbstractAnimation *>* QmlBehaviour::operations() +QmlList<QmlAbstractAnimation *>* QmlBehavior::operations() { - Q_D(QmlBehaviour); + Q_D(QmlBehavior); return &d->operations; } -QmlBehaviour::~QmlBehaviour() +QmlBehavior::~QmlBehavior() { //### do we need any other cleanup here? } -bool QmlBehaviour::_ignore = false; -void QmlBehaviour::propertyValueChanged() +bool QmlBehavior::_ignore = false; +void QmlBehavior::propertyValueChanged() { - Q_D(QmlBehaviour); + Q_D(QmlBehavior); if (_ignore) return; QVariant newValue = d->property.read(); - if ((!fromValue().isValid() || fromValue() == d->currentValue) && + if ((!fromValue().isValid() || fromValue() == d->currentValue) && (!toValue().isValid() || toValue() == newValue)) { //### does this clean up everything needed? @@ -220,9 +220,9 @@ void QmlBehaviour::propertyValueChanged() d->currentValue = newValue; } -void QmlBehaviour::setTarget(const QmlMetaProperty &property) +void QmlBehavior::setTarget(const QmlMetaProperty &property) { - Q_D(QmlBehaviour); + Q_D(QmlBehavior); d->property = property; d->currentValue = property.read(); d->property.connectNotifier(this, SLOT(propertyValueChanged())); @@ -233,4 +233,4 @@ void QmlBehaviour::setTarget(const QmlMetaProperty &property) QT_END_NAMESPACE -#include "qmlbehaviour.moc" +#include "qmlbehavior.moc" diff --git a/src/declarative/extra/qmlbehaviour.h b/src/declarative/extra/qmlbehavior.h index 99fc779..1be00c9 100644 --- a/src/declarative/extra/qmlbehaviour.h +++ b/src/declarative/extra/qmlbehavior.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QMLBEHAVIOUR_H -#define QMLBEHAVIOUR_H +#ifndef QMLBEHAVIOR_H +#define QMLBEHAVIOR_H #include <QtDeclarative/qmlpropertyvaluesource.h> #include <QtDeclarative/qml.h> @@ -53,11 +53,11 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) class QmlAbstractAnimation; -class QmlBehaviourPrivate; -class Q_DECLARATIVE_EXPORT QmlBehaviour : public QmlPropertyValueSource +class QmlBehaviorPrivate; +class Q_DECLARATIVE_EXPORT QmlBehavior : public QmlPropertyValueSource { Q_OBJECT - Q_DECLARE_PRIVATE(QmlBehaviour) + Q_DECLARE_PRIVATE(QmlBehavior) Q_PROPERTY(QVariant from READ fromValue WRITE setFromValue) Q_PROPERTY(QVariant to READ toValue WRITE setToValue) @@ -65,8 +65,8 @@ class Q_DECLARATIVE_EXPORT QmlBehaviour : public QmlPropertyValueSource Q_PROPERTY(QmlList<QmlAbstractAnimation *>* operations READ operations) public: - QmlBehaviour(QObject *parent=0); - ~QmlBehaviour(); + QmlBehavior(QObject *parent=0); + ~QmlBehavior(); QVariant fromValue() const; void setFromValue(const QVariant &); @@ -84,8 +84,8 @@ private Q_SLOTS: QT_END_NAMESPACE -QML_DECLARE_TYPE(QmlBehaviour) +QML_DECLARE_TYPE(QmlBehavior) QT_END_HEADER -#endif // QMLBEHAVIOUR_H +#endif // QMLBEHAVIOR_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 <QParallelAnimationGroup> #include <QSequentialAnimationGroup> #include <QtCore/qset.h> @@ -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; } } }; |