summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-02-17 07:20:27 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-02-17 07:20:27 (GMT)
commitc6961aaa1e10e395ef03f74caee9612a43344053 (patch)
tree4fcac34fe68c5637000fcc9912a8f2fecbb53685 /src/declarative
parent2b3ffec298b1c210d0e978c6c0e9cc4f51e72294 (diff)
parentf5668a63a9396b8f21a62a3a780f1e0023715806 (diff)
downloadQt-c6961aaa1e10e395ef03f74caee9612a43344053.zip
Qt-c6961aaa1e10e395ef03f74caee9612a43344053.tar.gz
Qt-c6961aaa1e10e395ef03f74caee9612a43344053.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsanchors.cpp26
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsflickable.cpp8
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsflickable_p.h12
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsitem.cpp4
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsitem.h6
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsloader.cpp1
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsloader_p.h4
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsmouseregion.cpp18
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsmouseregion_p.h22
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsrepeater.cpp9
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsrepeater_p.h7
-rw-r--r--src/declarative/qml/qmlcompiler.cpp12
-rw-r--r--src/declarative/qml/qmlobjectscriptclass.cpp6
-rw-r--r--src/declarative/util/qmlanimation.cpp14
-rw-r--r--src/declarative/util/qmlbehavior.cpp2
-rw-r--r--src/declarative/util/qmlpropertychanges.cpp2
-rw-r--r--src/declarative/util/qmlstateoperations.cpp8
-rw-r--r--src/declarative/util/qmlxmllistmodel.cpp4
18 files changed, 111 insertions, 54 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsanchors.cpp b/src/declarative/graphicsitems/qmlgraphicsanchors.cpp
index 816e580..15a6f24 100644
--- a/src/declarative/graphicsitems/qmlgraphicsanchors.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsanchors.cpp
@@ -364,7 +364,7 @@ void QmlGraphicsAnchors::setFill(QmlGraphicsItem *f)
return;
}
if (f != d->item->parentItem() && f->parentItem() != d->item->parentItem()){
- qmlInfo(d->item) << tr("Can't anchor to an item that isn't a parent or sibling.");
+ qmlInfo(d->item) << tr("Cannot anchor to an item that isn't a parent or sibling.");
return;
}
d->remDepend(d->fill);
@@ -398,7 +398,7 @@ void QmlGraphicsAnchors::setCenterIn(QmlGraphicsItem* c)
return;
}
if (c != d->item->parentItem() && c->parentItem() != d->item->parentItem()){
- qmlInfo(d->item) << tr("Can't anchor to an item that isn't a parent or sibling.");
+ qmlInfo(d->item) << tr("Cannot anchor to an item that isn't a parent or sibling.");
return;
}
@@ -989,7 +989,7 @@ bool QmlGraphicsAnchorsPrivate::checkHValid() const
if (usedAnchors & QmlGraphicsAnchors::HasLeftAnchor &&
usedAnchors & QmlGraphicsAnchors::HasRightAnchor &&
usedAnchors & QmlGraphicsAnchors::HasHCenterAnchor) {
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't specify left, right, and hcenter anchors.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot specify left, right, and hcenter anchors.");
return false;
}
@@ -999,16 +999,16 @@ bool QmlGraphicsAnchorsPrivate::checkHValid() const
bool QmlGraphicsAnchorsPrivate::checkHAnchorValid(QmlGraphicsAnchorLine anchor) const
{
if (!anchor.item) {
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't anchor to a null item.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot anchor to a null item.");
return false;
} else if (anchor.anchorLine & QmlGraphicsAnchorLine::Vertical_Mask) {
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't anchor a horizontal edge to a vertical edge.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot anchor a horizontal edge to a vertical edge.");
return false;
} else if (anchor.item != item->parentItem() && anchor.item->parentItem() != item->parentItem()){
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't anchor to an item that isn't a parent or sibling.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot anchor to an item that isn't a parent or sibling.");
return false;
} else if (anchor.item == item) {
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't anchor item to self.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot anchor item to self.");
return false;
}
@@ -1020,13 +1020,13 @@ bool QmlGraphicsAnchorsPrivate::checkVValid() const
if (usedAnchors & QmlGraphicsAnchors::HasTopAnchor &&
usedAnchors & QmlGraphicsAnchors::HasBottomAnchor &&
usedAnchors & QmlGraphicsAnchors::HasVCenterAnchor) {
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't specify top, bottom, and vcenter anchors.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot specify top, bottom, and vcenter anchors.");
return false;
} else if (usedAnchors & QmlGraphicsAnchors::HasBaselineAnchor &&
(usedAnchors & QmlGraphicsAnchors::HasTopAnchor ||
usedAnchors & QmlGraphicsAnchors::HasBottomAnchor ||
usedAnchors & QmlGraphicsAnchors::HasVCenterAnchor)) {
- qmlInfo(item) << QmlGraphicsAnchors::tr("Baseline anchor can't be used in conjunction with top, bottom, or vcenter anchors.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Baseline anchor cannot be used in conjunction with top, bottom, or vcenter anchors.");
return false;
}
@@ -1036,16 +1036,16 @@ bool QmlGraphicsAnchorsPrivate::checkVValid() const
bool QmlGraphicsAnchorsPrivate::checkVAnchorValid(QmlGraphicsAnchorLine anchor) const
{
if (!anchor.item) {
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't anchor to a null item.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot anchor to a null item.");
return false;
} else if (anchor.anchorLine & QmlGraphicsAnchorLine::Horizontal_Mask) {
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't anchor a vertical edge to a horizontal edge.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot anchor a vertical edge to a horizontal edge.");
return false;
} else if (anchor.item != item->parentItem() && anchor.item->parentItem() != item->parentItem()){
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't anchor to an item that isn't a parent or sibling.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot anchor to an item that isn't a parent or sibling.");
return false;
} else if (anchor.item == item){
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't anchor item to self.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot anchor item to self.");
return false;
}
diff --git a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp
index 5143251..39fe5b4 100644
--- a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp
@@ -1006,7 +1006,10 @@ bool QmlGraphicsFlickable::overShoot() const
void QmlGraphicsFlickable::setOverShoot(bool o)
{
Q_D(QmlGraphicsFlickable);
+ if (d->overShoot == o)
+ return;
d->overShoot = o;
+ emit overShootChanged();
}
/*!
@@ -1215,6 +1218,7 @@ void QmlGraphicsFlickable::setMaximumFlickVelocity(qreal v)
if (v == d->maxVelocity)
return;
d->maxVelocity = v;
+ emit maximumFlickVelocityChanged();
}
/*!
@@ -1232,7 +1236,10 @@ qreal QmlGraphicsFlickable::flickDeceleration() const
void QmlGraphicsFlickable::setFlickDeceleration(qreal deceleration)
{
Q_D(QmlGraphicsFlickable);
+ if (deceleration == d->deceleration)
+ return;
d->deceleration = deceleration;
+ emit flickDecelerationChanged();
}
/*!
@@ -1270,6 +1277,7 @@ void QmlGraphicsFlickable::setPressDelay(int delay)
if (d->pressDelay == delay)
return;
d->pressDelay = delay;
+ emit pressDelayChanged();
}
qreal QmlGraphicsFlickable::reportedVelocitySmoothing() const
diff --git a/src/declarative/graphicsitems/qmlgraphicsflickable_p.h b/src/declarative/graphicsitems/qmlgraphicsflickable_p.h
index ea07da4..5a1d15a 100644
--- a/src/declarative/graphicsitems/qmlgraphicsflickable_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicsflickable_p.h
@@ -65,15 +65,15 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsFlickable : public QmlGraphicsItem
Q_PROPERTY(qreal verticalVelocity READ verticalVelocity NOTIFY verticalVelocityChanged)
Q_PROPERTY(qreal reportedVelocitySmoothing READ reportedVelocitySmoothing WRITE setReportedVelocitySmoothing NOTIFY reportedVelocitySmoothingChanged)
- Q_PROPERTY(bool overShoot READ overShoot WRITE setOverShoot)
- Q_PROPERTY(qreal maximumFlickVelocity READ maximumFlickVelocity WRITE setMaximumFlickVelocity)
- Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration)
+ Q_PROPERTY(bool overShoot READ overShoot WRITE setOverShoot NOTIFY overShootChanged)
+ Q_PROPERTY(qreal maximumFlickVelocity READ maximumFlickVelocity WRITE setMaximumFlickVelocity NOTIFY maximumFlickVelocityChanged)
+ Q_PROPERTY(qreal flickDeceleration READ flickDeceleration WRITE setFlickDeceleration NOTIFY flickDecelerationChanged)
Q_PROPERTY(bool moving READ isMoving NOTIFY movingChanged)
Q_PROPERTY(bool flicking READ isFlicking NOTIFY flickingChanged)
Q_PROPERTY(FlickDirection flickDirection READ flickDirection WRITE setFlickDirection NOTIFY flickDirectionChanged)
Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged)
- Q_PROPERTY(int pressDelay READ pressDelay WRITE setPressDelay)
+ Q_PROPERTY(int pressDelay READ pressDelay WRITE setPressDelay NOTIFY pressDelayChanged)
Q_PROPERTY(bool atXEnd READ isAtXEnd NOTIFY isAtBoundaryChanged)
Q_PROPERTY(bool atYEnd READ isAtYEnd NOTIFY isAtBoundaryChanged)
@@ -160,6 +160,10 @@ Q_SIGNALS:
void pageChanged();
void flickDirectionChanged();
void interactiveChanged();
+ void overShootChanged();
+ void maximumFlickVelocityChanged();
+ void flickDecelerationChanged();
+ void pressDelayChanged();
protected:
virtual bool sceneEventFilter(QGraphicsItem *, QEvent *);
diff --git a/src/declarative/graphicsitems/qmlgraphicsitem.cpp b/src/declarative/graphicsitems/qmlgraphicsitem.cpp
index 2fbf18b..5cda430 100644
--- a/src/declarative/graphicsitems/qmlgraphicsitem.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsitem.cpp
@@ -1640,7 +1640,10 @@ bool QmlGraphicsItem::clip() const
void QmlGraphicsItem::setClip(bool c)
{
+ if (clip() == c)
+ return;
setFlag(ItemClipsChildrenToShape, c);
+ emit clipChanged();
}
/*!
@@ -2628,6 +2631,7 @@ void QmlGraphicsItem::setSmooth(bool smooth)
if (d->smooth == smooth)
return;
d->smooth = smooth;
+ emit smoothChanged();
update();
}
diff --git a/src/declarative/graphicsitems/qmlgraphicsitem.h b/src/declarative/graphicsitems/qmlgraphicsitem.h
index e0f33c7..ed4a7cf 100644
--- a/src/declarative/graphicsitems/qmlgraphicsitem.h
+++ b/src/declarative/graphicsitems/qmlgraphicsitem.h
@@ -88,12 +88,12 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsItem : public QGraphicsObject, public QmlP
Q_PROPERTY(QmlGraphicsAnchorLine verticalCenter READ verticalCenter CONSTANT FINAL)
Q_PROPERTY(QmlGraphicsAnchorLine baseline READ baseline CONSTANT FINAL)
Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged)
- Q_PROPERTY(bool clip READ clip WRITE setClip) // ### move to QGI/QGO, NOTIFY
+ Q_PROPERTY(bool clip READ clip WRITE setClip NOTIFY clipChanged) // ### move to QGI/QGO, NOTIFY
Q_PROPERTY(bool focus READ hasFocus WRITE setFocus NOTIFY focusChanged FINAL)
Q_PROPERTY(bool wantsFocus READ wantsFocus NOTIFY wantsFocusChanged)
Q_PROPERTY(QmlList<QGraphicsTransform *>* transform READ transform DESIGNABLE false FINAL)
Q_PROPERTY(TransformOrigin transformOrigin READ transformOrigin WRITE setTransformOrigin NOTIFY transformOriginChanged)
- Q_PROPERTY(bool smooth READ smooth WRITE setSmooth)
+ Q_PROPERTY(bool smooth READ smooth WRITE setSmooth NOTIFY smoothChanged)
Q_PROPERTY(QGraphicsEffect *effect READ graphicsEffect WRITE setGraphicsEffect)
Q_ENUMS(TransformOrigin)
Q_CLASSINFO("DefaultProperty", "data")
@@ -178,6 +178,8 @@ Q_SIGNALS:
void wantsFocusChanged();
void parentChanged();
void transformOriginChanged(TransformOrigin);
+ void smoothChanged();
+ void clipChanged();
protected:
bool isComponentComplete() const;
diff --git a/src/declarative/graphicsitems/qmlgraphicsloader.cpp b/src/declarative/graphicsitems/qmlgraphicsloader.cpp
index d778c83..342fec2 100644
--- a/src/declarative/graphicsitems/qmlgraphicsloader.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsloader.cpp
@@ -398,6 +398,7 @@ void QmlGraphicsLoader::setResizeMode(ResizeMode mode)
}
d->resizeMode = mode;
+ emit resizeModeChanged();
d->initResize();
}
diff --git a/src/declarative/graphicsitems/qmlgraphicsloader_p.h b/src/declarative/graphicsitems/qmlgraphicsloader_p.h
index 87b6a52..a115aa9 100644
--- a/src/declarative/graphicsitems/qmlgraphicsloader_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicsloader_p.h
@@ -59,7 +59,7 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsLoader : public QmlGraphicsItem
Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
Q_PROPERTY(QmlComponent *sourceComponent READ sourceComponent WRITE setSourceComponent NOTIFY sourceChanged)
- Q_PROPERTY(ResizeMode resizeMode READ resizeMode WRITE setResizeMode)
+ Q_PROPERTY(ResizeMode resizeMode READ resizeMode WRITE setResizeMode NOTIFY resizeModeChanged)
Q_PROPERTY(QGraphicsObject *item READ item NOTIFY itemChanged)
Q_PROPERTY(Status status READ status NOTIFY statusChanged)
Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
@@ -89,6 +89,8 @@ Q_SIGNALS:
void sourceChanged();
void statusChanged();
void progressChanged();
+ void resizeModeChanged();
+
protected:
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry);
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
diff --git a/src/declarative/graphicsitems/qmlgraphicsmouseregion.cpp b/src/declarative/graphicsitems/qmlgraphicsmouseregion.cpp
index fe72e84..003c18d 100644
--- a/src/declarative/graphicsitems/qmlgraphicsmouseregion.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsmouseregion.cpp
@@ -65,7 +65,10 @@ QmlGraphicsItem *QmlGraphicsDrag::target() const
void QmlGraphicsDrag::setTarget(QmlGraphicsItem *t)
{
+ if (_target == t)
+ return;
_target = t;
+ emit targetChanged();
}
QmlGraphicsDrag::Axis QmlGraphicsDrag::axis() const
@@ -75,7 +78,10 @@ QmlGraphicsDrag::Axis QmlGraphicsDrag::axis() const
void QmlGraphicsDrag::setAxis(QmlGraphicsDrag::Axis a)
{
+ if (_axis == a)
+ return;
_axis = a;
+ emit axisChanged();
}
qreal QmlGraphicsDrag::xmin() const
@@ -85,7 +91,10 @@ qreal QmlGraphicsDrag::xmin() const
void QmlGraphicsDrag::setXmin(qreal m)
{
+ if (_xmin == m)
+ return;
_xmin = m;
+ emit minimumXChanged();
}
qreal QmlGraphicsDrag::xmax() const
@@ -95,7 +104,10 @@ qreal QmlGraphicsDrag::xmax() const
void QmlGraphicsDrag::setXmax(qreal m)
{
+ if (_xmax == m)
+ return;
_xmax = m;
+ emit maximumXChanged();
}
qreal QmlGraphicsDrag::ymin() const
@@ -105,7 +117,10 @@ qreal QmlGraphicsDrag::ymin() const
void QmlGraphicsDrag::setYmin(qreal m)
{
+ if (_ymin == m)
+ return;
_ymin = m;
+ emit minimumYChanged();
}
qreal QmlGraphicsDrag::ymax() const
@@ -115,7 +130,10 @@ qreal QmlGraphicsDrag::ymax() const
void QmlGraphicsDrag::setYmax(qreal m)
{
+ if (_ymax == m)
+ return;
_ymax = m;
+ emit maximumYChanged();
}
QmlGraphicsMouseRegionPrivate::~QmlGraphicsMouseRegionPrivate()
diff --git a/src/declarative/graphicsitems/qmlgraphicsmouseregion_p.h b/src/declarative/graphicsitems/qmlgraphicsmouseregion_p.h
index 0ddad1b..1a8f83e 100644
--- a/src/declarative/graphicsitems/qmlgraphicsmouseregion_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicsmouseregion_p.h
@@ -55,12 +55,12 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsDrag : public QObject
Q_OBJECT
Q_ENUMS(Axis)
- Q_PROPERTY(QmlGraphicsItem *target READ target WRITE setTarget)
- Q_PROPERTY(Axis axis READ axis WRITE setAxis)
- Q_PROPERTY(qreal minimumX READ xmin WRITE setXmin)
- Q_PROPERTY(qreal maximumX READ xmax WRITE setXmax)
- Q_PROPERTY(qreal minimumY READ ymin WRITE setYmin)
- Q_PROPERTY(qreal maximumY READ ymax WRITE setYmax)
+ Q_PROPERTY(QmlGraphicsItem *target READ target WRITE setTarget NOTIFY targetChanged)
+ Q_PROPERTY(Axis axis READ axis WRITE setAxis NOTIFY axisChanged)
+ Q_PROPERTY(qreal minimumX READ xmin WRITE setXmin NOTIFY minimumXChanged)
+ Q_PROPERTY(qreal maximumX READ xmax WRITE setXmax NOTIFY maximumXChanged)
+ Q_PROPERTY(qreal minimumY READ ymin WRITE setYmin NOTIFY minimumYChanged)
+ Q_PROPERTY(qreal maximumY READ ymax WRITE setYmax NOTIFY maximumYChanged)
//### consider drag and drop
public:
@@ -83,6 +83,14 @@ public:
qreal ymax() const;
void setYmax(qreal);
+Q_SIGNALS:
+ void targetChanged();
+ void axisChanged();
+ void minimumXChanged();
+ void maximumXChanged();
+ void minimumYChanged();
+ void maximumYChanged();
+
private:
QmlGraphicsItem *_target;
Axis _axis;
@@ -107,7 +115,7 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsMouseRegion : public QmlGraphicsItem
Q_PROPERTY(Qt::MouseButtons pressedButtons READ pressedButtons NOTIFY pressedChanged)
Q_PROPERTY(Qt::MouseButtons acceptedButtons READ acceptedButtons WRITE setAcceptedButtons NOTIFY acceptedButtonsChanged)
Q_PROPERTY(bool hoverEnabled READ acceptHoverEvents WRITE setAcceptHoverEvents)
- Q_PROPERTY(QmlGraphicsDrag *drag READ drag) //### add flicking to QmlGraphicsDrag or add a QmlGraphicsFlick ???
+ Q_PROPERTY(QmlGraphicsDrag *drag READ drag CONSTANT) //### add flicking to QmlGraphicsDrag or add a QmlGraphicsFlick ???
public:
QmlGraphicsMouseRegion(QmlGraphicsItem *parent=0);
diff --git a/src/declarative/graphicsitems/qmlgraphicsrepeater.cpp b/src/declarative/graphicsitems/qmlgraphicsrepeater.cpp
index f0e5bb3..4b01952 100644
--- a/src/declarative/graphicsitems/qmlgraphicsrepeater.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsrepeater.cpp
@@ -157,6 +157,9 @@ QVariant QmlGraphicsRepeater::model() const
void QmlGraphicsRepeater::setModel(const QVariant &model)
{
Q_D(QmlGraphicsRepeater);
+ if (d->dataSource == model)
+ return;
+
clear();
if (d->model) {
disconnect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int)));
@@ -168,6 +171,7 @@ void QmlGraphicsRepeater::setModel(const QVariant &model)
*/
}
d->dataSource = model;
+ emit modelChanged();
QObject *object = qvariant_cast<QObject*>(model);
QmlGraphicsVisualModel *vim = 0;
if (object && (vim = qobject_cast<QmlGraphicsVisualModel *>(object))) {
@@ -219,6 +223,10 @@ QmlComponent *QmlGraphicsRepeater::delegate() const
void QmlGraphicsRepeater::setDelegate(QmlComponent *delegate)
{
Q_D(QmlGraphicsRepeater);
+ if (QmlGraphicsVisualDataModel *dataModel = qobject_cast<QmlGraphicsVisualDataModel*>(d->model))
+ if (delegate == dataModel->delegate())
+ return;
+
if (!d->ownModel) {
d->model = new QmlGraphicsVisualDataModel(qmlContext(this));
d->ownModel = true;
@@ -226,6 +234,7 @@ void QmlGraphicsRepeater::setDelegate(QmlComponent *delegate)
if (QmlGraphicsVisualDataModel *dataModel = qobject_cast<QmlGraphicsVisualDataModel*>(d->model)) {
dataModel->setDelegate(delegate);
regenerate();
+ emit delegateChanged();
}
}
diff --git a/src/declarative/graphicsitems/qmlgraphicsrepeater_p.h b/src/declarative/graphicsitems/qmlgraphicsrepeater_p.h
index 61f82d7..d0c009f 100644
--- a/src/declarative/graphicsitems/qmlgraphicsrepeater_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicsrepeater_p.h
@@ -55,8 +55,8 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsRepeater : public QmlGraphicsItem
{
Q_OBJECT
- Q_PROPERTY(QVariant model READ model WRITE setModel)
- Q_PROPERTY(QmlComponent *delegate READ delegate WRITE setDelegate)
+ Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged)
+ Q_PROPERTY(QmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
Q_PROPERTY(int count READ count NOTIFY countChanged)
Q_CLASSINFO("DefaultProperty", "delegate")
@@ -73,8 +73,9 @@ public:
int count() const;
Q_SIGNALS:
+ void modelChanged();
+ void delegateChanged();
void countChanged();
-
private:
void clear();
void regenerate();
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index 10150de..9990c06 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -730,7 +730,7 @@ bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt)
compileState.parserStatusCount++;
// Check if this is a custom parser type. Custom parser types allow
- // assignments to non-existant properties. These assignments are then
+ // assignments to non-existent properties. These assignments are then
// compiled by the type.
bool isCustomParser = output->types.at(obj->type).type &&
output->types.at(obj->type).type->customParser() != 0;
@@ -1429,7 +1429,7 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop,
ctxt));
return true;
} else if (!type || !type->attachedPropertiesType()) {
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Non-existant attached object"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Non-existent attached object"));
}
if (!prop->value)
@@ -1486,9 +1486,9 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop,
} else if (prop->index == -1) {
if (prop->isDefault) {
- COMPILE_EXCEPTION(prop->values.first(), QCoreApplication::translate("QmlCompiler","Cannot assign to non-existant default property"));
+ COMPILE_EXCEPTION(prop->values.first(), QCoreApplication::translate("QmlCompiler","Cannot assign to non-existent default property"));
} else {
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Cannot assign to non-existant property \"%1\"").arg(QString::fromUtf8(prop->name)));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Cannot assign to non-existent property \"%1\"").arg(QString::fromUtf8(prop->name)));
}
} else if (prop->value) {
@@ -1534,7 +1534,7 @@ QmlCompiler::buildPropertyInNamespace(QmlEnginePrivate::ImportedNamespace *ns,
&type, 0, 0, 0);
if (!type || !type->attachedPropertiesType())
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Non-existant attached object"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Non-existent attached object"));
if (!prop->value)
COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Invalid attached object assignment"));
@@ -1841,7 +1841,7 @@ bool QmlCompiler::buildValueTypeProperty(QObject *type,
foreach (Property *prop, obj->properties) {
int idx = type->metaObject()->indexOfProperty(prop->name.constData());
if (idx == -1)
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Cannot assign to non-existant property \"%1\"").arg(QString::fromUtf8(prop->name)));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Cannot assign to non-existent property \"%1\"").arg(QString::fromUtf8(prop->name)));
QMetaProperty p = type->metaObject()->property(idx);
prop->index = idx;
prop->type = p.userType();
diff --git a/src/declarative/qml/qmlobjectscriptclass.cpp b/src/declarative/qml/qmlobjectscriptclass.cpp
index 1c41d46..c373a8e 100644
--- a/src/declarative/qml/qmlobjectscriptclass.cpp
+++ b/src/declarative/qml/qmlobjectscriptclass.cpp
@@ -313,7 +313,7 @@ void QmlObjectScriptClass::setProperty(QObject *obj,
Q_ASSERT(lastData);
if (!lastData->isValid()) {
- QString error = QLatin1String("Cannot assign to non-existant property \"") +
+ QString error = QLatin1String("Cannot assign to non-existent property \"") +
toString(name) + QLatin1Char('\"');
if (context())
context()->throwError(error);
@@ -628,11 +628,11 @@ QmlObjectMethodScriptClass::Value QmlObjectMethodScriptClass::call(Object *o, QS
for (int ii = 0; ii < argTypeNames.count(); ++ii) {
argTypes[ii] = QMetaType::type(argTypeNames.at(ii));
if (argTypes[ii] == QVariant::Invalid)
- return Value(ctxt, ctxt->throwError(QString(QLatin1String("Unknown method parameter type: %1")).arg(QLatin1String(argTypeNames.at(ii)))));
+ return Value(ctxt, ctxt->throwError(QString::fromLatin1("Unknown method parameter type: %1").arg(QLatin1String(argTypeNames.at(ii)))));
}
if (argTypes.count() > ctxt->argumentCount())
- return Value(ctxt, ctxt->throwError("Insufficient arguments"));
+ return Value(ctxt, ctxt->throwError(QLatin1String("Insufficient arguments")));
QVarLengthArray<MetaCallArgument, 9> args(argTypes.count() + 1);
args[0].initAsType(method->data.propType, engine);
diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp
index abffefe..6609c73 100644
--- a/src/declarative/util/qmlanimation.cpp
+++ b/src/declarative/util/qmlanimation.cpp
@@ -77,7 +77,7 @@ static QEasingCurve stringToCurve(const QString &curve, QObject *obj)
if (hasParams) {
QString easeName = curve.trimmed();
if (!easeName.endsWith(QLatin1Char(')'))) {
- qmlInfo(obj) << obj->tr("Unmatched parenthesis in easing function \"%1\"").arg(curve);
+ qmlInfo(obj) << QmlPropertyAnimation::tr("Unmatched parenthesis in easing function \"%1\"").arg(curve);
return easingCurve;
}
@@ -86,7 +86,7 @@ static QEasingCurve stringToCurve(const QString &curve, QObject *obj)
easeName.mid(idx + 1, easeName.length() - 1 - idx - 1);
normalizedCurve = easeName.left(idx);
if (!normalizedCurve.startsWith(QLatin1String("ease"))) {
- qmlInfo(obj) << obj->tr("Easing function \"%1\" must start with \"ease\"").arg(curve);
+ qmlInfo(obj) << QmlPropertyAnimation::tr("Easing function \"%1\" must start with \"ease\"").arg(curve);
return easingCurve;
}
@@ -101,7 +101,7 @@ static QEasingCurve stringToCurve(const QString &curve, QObject *obj)
int value = me.keyToValue(normalizedCurve.toUtf8().constData());
if (value < 0) {
- qmlInfo(obj) << obj->tr("Unknown easing curve \"%1\"").arg(curve);
+ qmlInfo(obj) << QmlPropertyAnimation::tr("Unknown easing curve \"%1\"").arg(curve);
return easingCurve;
}
easingCurve.setType((QEasingCurve::Type)value);
@@ -111,7 +111,7 @@ static QEasingCurve stringToCurve(const QString &curve, QObject *obj)
int sep = str.indexOf(QLatin1Char(':'));
if (sep == -1) {
- qmlInfo(obj) << obj->tr("Improperly specified parameter in easing function \"%1\"").arg(curve);
+ qmlInfo(obj) << QmlPropertyAnimation::tr("Improperly specified parameter in easing function \"%1\"").arg(curve);
continue;
}
@@ -120,7 +120,7 @@ static QEasingCurve stringToCurve(const QString &curve, QObject *obj)
qreal propValue = str.mid(sep + 1).trimmed().toDouble(&isOk);
if (propName.isEmpty() || !isOk) {
- qmlInfo(obj) << obj->tr("Improperly specified parameter in easing function \"%1\"").arg(curve);
+ qmlInfo(obj) << QmlPropertyAnimation::tr("Improperly specified parameter in easing function \"%1\"").arg(curve);
continue;
}
@@ -131,7 +131,7 @@ static QEasingCurve stringToCurve(const QString &curve, QObject *obj)
} else if (propName == QLatin1String("overshoot")) {
easingCurve.setOvershoot(propValue);
} else {
- qmlInfo(obj) << obj->tr("Unknown easing parameter \"%1\"").arg(propName);
+ qmlInfo(obj) << QmlPropertyAnimation::tr("Unknown easing parameter \"%1\"").arg(propName);
continue;
}
}
@@ -226,7 +226,7 @@ QmlMetaProperty QmlAbstractAnimationPrivate::createProperty(QObject *obj, const
{
QmlMetaProperty prop = QmlMetaProperty::createProperty(obj, str, qmlContext(infoObj));
if (!prop.isValid()) {
- qmlInfo(infoObj) << QmlAbstractAnimation::tr("Cannot animate non-existant property \"%1\"").arg(str);
+ qmlInfo(infoObj) << QmlAbstractAnimation::tr("Cannot animate non-existent property \"%1\"").arg(str);
return QmlMetaProperty();
} else if (!prop.isWritable()) {
qmlInfo(infoObj) << QmlAbstractAnimation::tr("Cannot animate read-only property \"%1\"").arg(str);
diff --git a/src/declarative/util/qmlbehavior.cpp b/src/declarative/util/qmlbehavior.cpp
index b9c77f5..e8feeaa 100644
--- a/src/declarative/util/qmlbehavior.cpp
+++ b/src/declarative/util/qmlbehavior.cpp
@@ -119,7 +119,7 @@ void QmlBehavior::setAnimation(QmlAbstractAnimation *animation)
{
Q_D(QmlBehavior);
if (d->animation) {
- qmlInfo(this) << tr("Can't change the animation assigned to a Behavior.");
+ qmlInfo(this) << tr("Cannot change the animation assigned to a Behavior.");
return;
}
diff --git a/src/declarative/util/qmlpropertychanges.cpp b/src/declarative/util/qmlpropertychanges.cpp
index 68fc5cc..f1f39da 100644
--- a/src/declarative/util/qmlpropertychanges.cpp
+++ b/src/declarative/util/qmlpropertychanges.cpp
@@ -357,7 +357,7 @@ QmlPropertyChangesPrivate::property(const QByteArray &property)
Q_Q(QmlPropertyChanges);
QmlMetaProperty prop = QmlMetaProperty::createProperty(object, QString::fromUtf8(property));
if (!prop.isValid()) {
- qmlInfo(q) << QmlPropertyChanges::tr("Cannot assign to non-existant property \"%1\"").arg(QString::fromUtf8(property));
+ qmlInfo(q) << QmlPropertyChanges::tr("Cannot assign to non-existent property \"%1\"").arg(QString::fromUtf8(property));
return QmlMetaProperty();
} else if (!(prop.type() & QmlMetaProperty::SignalProperty) && !prop.isWritable()) {
qmlInfo(q) << QmlPropertyChanges::tr("Cannot assign to read-only property \"%1\"").arg(QString::fromUtf8(property));
diff --git a/src/declarative/util/qmlstateoperations.cpp b/src/declarative/util/qmlstateoperations.cpp
index 35c8f7d..cefe2bc 100644
--- a/src/declarative/util/qmlstateoperations.cpp
+++ b/src/declarative/util/qmlstateoperations.cpp
@@ -82,7 +82,7 @@ void QmlParentChangePrivate::doChange(QmlGraphicsItem *targetParent, QmlGraphics
bool ok;
const QTransform &transform = target->itemTransform(targetParent, &ok);
if (transform.type() >= QTransform::TxShear || !ok) {
- qmlInfo(q) << QObject::tr("Unable to preserve appearance under complex transform");
+ qmlInfo(q) << QmlParentChange::tr("Unable to preserve appearance under complex transform");
ok = false;
}
@@ -92,21 +92,21 @@ void QmlParentChangePrivate::doChange(QmlGraphicsItem *targetParent, QmlGraphics
if (transform.m11() == transform.m22())
scale = transform.m11();
else {
- qmlInfo(q) << QObject::tr("Unable to preserve appearance under non-uniform scale");
+ qmlInfo(q) << QmlParentChange::tr("Unable to preserve appearance under non-uniform scale");
ok = false;
}
} else if (ok && transform.type() == QTransform::TxRotate) {
if (transform.m11() == transform.m22())
scale = qSqrt(transform.m11()*transform.m11() + transform.m12()*transform.m12());
else {
- qmlInfo(q) << QObject::tr("Unable to preserve appearance under non-uniform scale");
+ qmlInfo(q) << QmlParentChange::tr("Unable to preserve appearance under non-uniform scale");
ok = false;
}
if (scale != 0)
rotation = atan2(transform.m12()/scale, transform.m11()/scale) * 180/M_PI;
else {
- qmlInfo(q) << QObject::tr("Unable to preserve appearance under scale of 0");
+ qmlInfo(q) << QmlParentChange::tr("Unable to preserve appearance under scale of 0");
ok = false;
}
}
diff --git a/src/declarative/util/qmlxmllistmodel.cpp b/src/declarative/util/qmlxmllistmodel.cpp
index df2102a..3612369 100644
--- a/src/declarative/util/qmlxmllistmodel.cpp
+++ b/src/declarative/util/qmlxmllistmodel.cpp
@@ -393,7 +393,7 @@ void QmlXmlRoleList::insert(int i, QmlXmlListModelRole *role)
{
QmlConcreteList<QmlXmlListModelRole *>::insert(i, role);
if (model->roleNames.contains(role->name())) {
- qmlInfo(role) << QObject::tr("\"%1\" duplicates a previous role name and will be disabled.").arg(role->name());
+ qmlInfo(role) << QCoreApplication::translate("QmlXmlRoleList", "\"%1\" duplicates a previous role name and will be disabled.").arg(role->name());
return;
}
model->roles.insert(i, model->highestRole);
@@ -553,7 +553,7 @@ void QmlXmlListModel::setQuery(const QString &query)
{
Q_D(QmlXmlListModel);
if (!query.startsWith(QLatin1Char('/'))) {
- qmlInfo(this) << tr("An XmlListModel query must start with '/' or \"//\"");
+ qmlInfo(this) << QCoreApplication::translate("QmlXmlRoleList", "An XmlListModel query must start with '/' or \"//\"");
return;
}