diff options
-rw-r--r-- | demos/declarative/calculator/calculator.qml | 2 | ||||
-rw-r--r-- | demos/declarative/contacts/Contact.qml | 5 | ||||
-rw-r--r-- | demos/declarative/flickr/content/MediaLineEdit.qml | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfxitem.cpp | 2 | ||||
-rw-r--r-- | src/declarative/fx/qfxtextinput.cpp | 8 | ||||
-rw-r--r-- | src/declarative/fx/qfxtextinput.h | 3 | ||||
-rw-r--r-- | src/declarative/util/qmlbind.cpp | 20 | ||||
-rw-r--r-- | src/declarative/util/qmlconnection.cpp | 20 | ||||
-rw-r--r-- | src/declarative/util/qmlscript.cpp | 12 | ||||
-rw-r--r-- | src/declarative/util/qmlsetproperties.cpp | 55 | ||||
-rw-r--r-- | src/declarative/util/qmlstate.cpp | 34 | ||||
-rw-r--r-- | src/declarative/util/qmltransition.cpp | 28 | ||||
-rw-r--r-- | tests/auto/declarative/anchors/tst_anchors.cpp | 6 | ||||
-rw-r--r-- | tests/auto/declarative/layouts/tst_layouts.cpp | 17 | ||||
-rw-r--r-- | tests/auto/declarative/listview/tst_listview.cpp | 6 | ||||
-rw-r--r-- | tests/auto/declarative/pathview/data/pathview.qml | 2 | ||||
-rw-r--r-- | tests/auto/declarative/pathview/tst_pathview.cpp | 18 | ||||
-rw-r--r-- | tests/auto/declarative/repeater/tst_repeater.cpp | 6 |
18 files changed, 64 insertions, 182 deletions
diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml index f766a30..56bdc4d 100644 --- a/demos/declarative/calculator/calculator.qml +++ b/demos/declarative/calculator/calculator.qml @@ -8,7 +8,7 @@ Rect { Script { source: "calculator.js" } VerticalPositioner { - x: 2; spacing: 10; margin: 2 + x: 2; spacing: 10; Rect { id: Container diff --git a/demos/declarative/contacts/Contact.qml b/demos/declarative/contacts/Contact.qml index c6ed906..d02157c 100644 --- a/demos/declarative/contacts/Contact.qml +++ b/demos/declarative/contacts/Contact.qml @@ -82,9 +82,10 @@ Item { } VerticalPositioner { id: layout - anchors.fill: parent + width: contents.width + height:contents.height + anchors.centerIn: parent spacing: 5 - margin: 5 ContactField { id: labelField anchors.left: layout.left diff --git a/demos/declarative/flickr/content/MediaLineEdit.qml b/demos/declarative/flickr/content/MediaLineEdit.qml index e175b4e..1642d44 100644 --- a/demos/declarative/flickr/content/MediaLineEdit.qml +++ b/demos/declarative/flickr/content/MediaLineEdit.qml @@ -86,7 +86,7 @@ Item { text: Container.label + "..." } - TextEdit { + TextInput { id: Editor font.bold: true color: "white" diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index 572fcc7..cca21b9 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -331,7 +331,7 @@ void QFxContents::setItem(QFxItem *item) \code Item { focus: true - key.onLeftPressed: print("move left") + Keys.onLeftPressed: print("move left") } \endcode diff --git a/src/declarative/fx/qfxtextinput.cpp b/src/declarative/fx/qfxtextinput.cpp index 1407a78..eb6c5bf 100644 --- a/src/declarative/fx/qfxtextinput.cpp +++ b/src/declarative/fx/qfxtextinput.cpp @@ -194,6 +194,7 @@ void QFxTextInput::setHAlign(HAlignment align) { Q_D(QFxTextInput); d->hAlign = align; + //TODO: implement } bool QFxTextInput::isReadOnly() const @@ -513,6 +514,13 @@ void QFxTextInput::drawContents(QPainter *p, const QRect &r) p->restore(); } +void QFxTextInput::selectAll() +{ + Q_D(QFxTextInput); + d->control->setSelection(0, d->control->text().length()); +} + + /*! \qmlproperty bool LineEdit::smooth diff --git a/src/declarative/fx/qfxtextinput.h b/src/declarative/fx/qfxtextinput.h index fe72f1e..b5812d4 100644 --- a/src/declarative/fx/qfxtextinput.h +++ b/src/declarative/fx/qfxtextinput.h @@ -169,6 +169,9 @@ protected: void focusChanged(bool hasFocus); +public Q_SLOTS: + void selectAll(); + private Q_SLOTS: void updateSize(); void q_textChanged(); diff --git a/src/declarative/util/qmlbind.cpp b/src/declarative/util/qmlbind.cpp index 2ba8802..f3b5fa4 100644 --- a/src/declarative/util/qmlbind.cpp +++ b/src/declarative/util/qmlbind.cpp @@ -73,8 +73,8 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Bind,QmlBind) to QML by C++. In these cases, regular property binding doesn't work. Bind allows you to bind any value to any property. - For example, imagine a C++ application that maps an "app.enteredText" - property into QML. You could use Bind to update the enteredText property + For example, imagine a C++ application that maps an "app.enteredText" + property into QML. You could use Bind to update the enteredText property like this. \code TextEdit { id: myTextField; text: "Please type here..." } @@ -83,7 +83,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Bind,QmlBind) Whenever the text in the TextEdit is updated, the C++ property will be updated also. - If the bind target or bind property is changed, the bound value is + If the bind target or bind property is changed, the bound value is immediately pushed onto the new target. \sa {qmlforcpp}{Qt Declarative Markup Language For C++ Programmers} @@ -126,10 +126,6 @@ void QmlBind::setWhen(bool v) \qmlproperty Object Bind::target The object to be updated. - */ -/*! - \property QmlBind::target - \brief the object to be updated. */ QObject *QmlBind::object() { @@ -148,10 +144,6 @@ void QmlBind::setObject(QObject *obj) \qmlproperty string Bind::property The property to be updated. - */ -/*! - \property QmlBind::property - \brief the property of the target to be updated. */ QString QmlBind::property() const { @@ -169,12 +161,8 @@ void QmlBind::setProperty(const QString &p) /*! \qmlproperty any Bind::value - The value to be set on the target object and property. This can be a + The value to be set on the target object and property. This can be a constant (which isn't very useful), or a bound expression. - */ -/*! - \property QmlBind::value - \brief the value to bind to. */ QVariant QmlBind::value() const { diff --git a/src/declarative/util/qmlconnection.cpp b/src/declarative/util/qmlconnection.cpp index 24bb61f..83804a5 100644 --- a/src/declarative/util/qmlconnection.cpp +++ b/src/declarative/util/qmlconnection.cpp @@ -134,16 +134,6 @@ QmlConnection::~QmlConnection() By default, the sender is assumed to be the parent of the Connection. */ - -/*! - \property QmlConnection::sender - \brief the object that sends the signal. - - By default, the sender is assumed to be the parent of the Connection. - - Note that the set/get methods are setSignalSender() and signalSender(), - due to the pre-existence of QObject::sender(). -*/ QObject *QmlConnection::signalSender() const { Q_D(const QmlConnection); @@ -233,11 +223,6 @@ void QmlConnection::componentComplete() This is the default attribute of Connection. */ - -/*! - \property QmlConnection::script - \brief the JavaScript executed whenever the signal is sent. -*/ QString QmlConnection::script() const { Q_D(const QmlConnection); @@ -275,11 +260,6 @@ Connection { } \endqml */ - -/*! - \property QmlConnection::signal - \brief the signal from the sender to which the script is attached. -*/ QString QmlConnection::signal() const { Q_D(const QmlConnection); diff --git a/src/declarative/util/qmlscript.cpp b/src/declarative/util/qmlscript.cpp index 6bc21a2..0bff047 100644 --- a/src/declarative/util/qmlscript.cpp +++ b/src/declarative/util/qmlscript.cpp @@ -109,10 +109,6 @@ QmlScript::QmlScript(QObject *parent) : QObject(*(new QmlScriptPrivate), parent) \default JavaScript code to execute. */ -/*! - \property QmlScript::script - \brief a script snippet. -*/ QString QmlScript::script() const { Q_D(const QmlScript); @@ -131,10 +127,6 @@ void QmlScript::setScript(const QString &script) Setting this property causes the Script element to read JavaScript code from the file specified. - */ -/*! - \property QmlScript::source - \brief the path to a script file. */ QUrl QmlScript::source() const { @@ -148,7 +140,7 @@ void QmlScript::setSource(const QUrl &source) if (d->url == source) return; d->url = qmlContext(this)->resolvedUrl(source); - + #ifndef QT_NO_LOCALFILE_OPTIMIZED_QML if (d->url.scheme() == QLatin1String("file")) { QFile file(d->url.toLocalFile()); @@ -198,7 +190,7 @@ void QmlScriptPrivate::addScriptToEngine(const QString &script, const QString &s if (scriptEngine->uncaughtException().isError()){ QScriptValue exception = scriptEngine->uncaughtException(); if (!exception.property(QLatin1String("fileName")).toString().isEmpty()){ - qWarning() << exception.property(QLatin1String("fileName")).toString() + qWarning() << exception.property(QLatin1String("fileName")).toString() << scriptEngine->uncaughtExceptionLineNumber() << exception.toString(); diff --git a/src/declarative/util/qmlsetproperties.cpp b/src/declarative/util/qmlsetproperties.cpp index a08f4ba..e7be329 100644 --- a/src/declarative/util/qmlsetproperties.cpp +++ b/src/declarative/util/qmlsetproperties.cpp @@ -56,9 +56,8 @@ QT_BEGIN_NAMESPACE \qmlclass SetProperties QmlSetProperties \brief The SetProperties element describes new property values for a state. - SetProperties is a convenience element for changing many properties on a single - object. It allows you to specify the property names and values similar to how - you normally would specify them for the actual item: + SetProperties changes the properties of an item. It allows you to specify the property + names and values similar to how you normally would specify them for the actual item: \code SetProperties { @@ -68,38 +67,12 @@ QT_BEGIN_NAMESPACE width: 48 } \endcode - - \c target is a property of \c SetProperties, so if the property you want to change - is named \e target you will have to use \l SetProperty instead. You should also - use \l SetProperty if you want to update the binding for a property, - as SetProperties does not support this. */ /*! \internal \class QmlSetProperties \brief The QmlSetProperties class describes new property values for a state. - - \ingroup group_states - - QmlSetProperties is a convenience class for changing many properties on a single - object. It allows you to specify the property names and values similar to how - you normally would specify them for the actual item: - - \code - SetProperties { - target: myRect - x: 52 - y: 300 - width: 48 - } - \endcode - - \c target is a property of \c SetProperties, so if the property you want to change - is named \e target you will have to use QmlSetProperty instead. You should also use QmlSetProperty - if you want to update the binding for a property, as QmlSetProperties does not support this. - - \sa QmlSetProperty */ /*! @@ -107,15 +80,11 @@ QT_BEGIN_NAMESPACE This property holds the object that the properties to change belong to */ -/*! - \property QmlSetProperties::target - \brief the object that the properties to change belong to -*/ class QmlSetPropertiesPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QmlSetProperties) public: - QmlSetPropertiesPrivate() : object(0), decoded(true), restore(true), + QmlSetPropertiesPrivate() : object(0), decoded(true), restore(true), isExplicit(false) {} QObject *object; @@ -141,9 +110,9 @@ public: virtual void setCustomData(QObject *, const QByteArray &); }; -void -QmlSetPropertiesParser::compileList(QList<QPair<QByteArray, QVariant> > &list, - const QByteArray &pre, +void +QmlSetPropertiesParser::compileList(QList<QPair<QByteArray, QVariant> > &list, + const QByteArray &pre, const QmlCustomParserProperty &prop) { QByteArray propName = pre + prop.name(); @@ -156,7 +125,7 @@ QmlSetPropertiesParser::compileList(QList<QPair<QByteArray, QVariant> > &list, continue; } else if(value.userType() == qMetaTypeId<QmlCustomParserProperty>()) { - QmlCustomParserProperty prop = + QmlCustomParserProperty prop = qvariant_cast<QmlCustomParserProperty>(value); QByteArray pre = propName + "."; compileList(list, pre, prop); @@ -167,8 +136,8 @@ QmlSetPropertiesParser::compileList(QList<QPair<QByteArray, QVariant> > &list, } } -QByteArray -QmlSetPropertiesParser::compile(const QList<QmlCustomParserProperty> &props, +QByteArray +QmlSetPropertiesParser::compile(const QList<QmlCustomParserProperty> &props, bool *ok) { *ok = true; @@ -238,10 +207,10 @@ void QmlSetPropertiesPrivate::decode() data.clear(); } -void QmlSetPropertiesParser::setCustomData(QObject *object, +void QmlSetPropertiesParser::setCustomData(QObject *object, const QByteArray &data) { - QmlSetPropertiesPrivate *p = + QmlSetPropertiesPrivate *p = static_cast<QmlSetPropertiesPrivate *>(QObjectPrivate::get(object)); p->data = data; p->decoded = false; @@ -310,7 +279,7 @@ QmlSetProperties::ActionList QmlSetProperties::actions() QByteArray property = d->properties.at(ii).first; - Action a(d->object, QString::fromLatin1(property), + Action a(d->object, QString::fromLatin1(property), d->properties.at(ii).second); if (a.property.isValid()) { diff --git a/src/declarative/util/qmlstate.cpp b/src/declarative/util/qmlstate.cpp index 9967486..ce94aa8 100644 --- a/src/declarative/util/qmlstate.cpp +++ b/src/declarative/util/qmlstate.cpp @@ -168,13 +168,6 @@ QmlState::~QmlState() Each state should have a unique name. */ - -/*! - \property QmlState::name - \brief the name of the state - - Each state should have a unique name. -*/ QString QmlState::name() const { Q_D(const QmlState); @@ -200,14 +193,6 @@ bool QmlState::isWhenKnown() const This should be set to an expression that evaluates to true when you want the state to be applied. */ - -/*! - \property QmlState::when - \brief when the state should be applied - - This should be set to an expression that evaluates to true when you want the state to - be applied. -*/ QmlBinding *QmlState::when() const { Q_D(const QmlState); @@ -229,16 +214,6 @@ void QmlState::setWhen(QmlBinding *when) The state being extended is treated as the base state in regards to the changes specified by the extending state. */ - -/*! - \property QmlState::extends - \brief the state that this state extends - - The state being extended is treated as the base state in regards to - the changes specified by the extending state. - - \sa operations -*/ QString QmlState::extends() const { Q_D(const QmlState); @@ -260,15 +235,6 @@ void QmlState::setExtends(const QString &extends) extends another state, then the changes are applied against the state being extended. */ - -/*! - \property QmlState::operations - \brief the changes to apply for this state - - By default these changes are applied against the default state. If the state - extends another state, then the changes are applied against the state being - extended. -*/ QmlList<QmlStateOperation *> *QmlState::operations() { Q_D(QmlState); diff --git a/src/declarative/util/qmltransition.cpp b/src/declarative/util/qmltransition.cpp index a9b8cb3..fd22f6b 100644 --- a/src/declarative/util/qmltransition.cpp +++ b/src/declarative/util/qmltransition.cpp @@ -198,14 +198,6 @@ void QmlTransition::prepare(QmlStateOperation::ActionList &actions, } \endcode */ - -/*! - \property QmlTransition::fromState - \brief a selector indicating which states, when left, should trigger the transition. - - fromState is used in conjunction with toState to determine when a transition should - be applied. The default value is "*" (any state). -*/ QString QmlTransition::fromState() const { Q_D(const QmlTransition); @@ -224,14 +216,6 @@ void QmlTransition::setFromState(const QString &f) The default value is false. */ - - -/*! - \property QmlTransition::reversible - \brief whether the transition should be automatically reversed when the conditions that triggered this transition are reversed. - - The default value is false. -*/ bool QmlTransition::reversible() const { Q_D(const QmlTransition); @@ -244,13 +228,6 @@ void QmlTransition::setReversible(bool r) d->reversible = r; } -/*! - \property QmlTransition::toState - \brief a selector indicating which states, when entered, should trigger the transition. - - toState is used in conjunction with fromState to determine when a transition should - be applied. The default value is "*" (any state). -*/ QString QmlTransition::toState() const { Q_D(const QmlTransition); @@ -272,11 +249,6 @@ void QmlTransition::setToState(const QString &t) which contains all the animations, and assign that to operations. \default */ - -/*! - \property QmlTransition::operations - \brief a list of the transition animations to be run. -*/ QmlList<QmlAbstractAnimation *>* QmlTransition::operations() { Q_D(QmlTransition); diff --git a/tests/auto/declarative/anchors/tst_anchors.cpp b/tests/auto/declarative/anchors/tst_anchors.cpp index 4830169..98ede65 100644 --- a/tests/auto/declarative/anchors/tst_anchors.cpp +++ b/tests/auto/declarative/anchors/tst_anchors.cpp @@ -25,15 +25,15 @@ private slots: Find an item with the specified id. */ template<typename T> -T *tst_anchors::findItem(QFxItem *parent, const QString &id) +T *tst_anchors::findItem(QFxItem *parent, const QString &objectName) { const QMetaObject &mo = T::staticMetaObject; for (int i = 0; i < parent->QSimpleCanvasItem::children().count(); ++i) { QFxItem *item = qobject_cast<QFxItem*>(parent->QSimpleCanvasItem::children().at(i)); - if (mo.cast(item) && (id.isEmpty() || item->id() == id)) { + if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { return static_cast<T*>(item); } - item = findItem<T>(item, id); + item = findItem<T>(item, objectName); if (item) return static_cast<T*>(item); } diff --git a/tests/auto/declarative/layouts/tst_layouts.cpp b/tests/auto/declarative/layouts/tst_layouts.cpp index 466a7de..cd4678e 100644 --- a/tests/auto/declarative/layouts/tst_layouts.cpp +++ b/tests/auto/declarative/layouts/tst_layouts.cpp @@ -21,7 +21,7 @@ private slots: private: QFxView *createView(const QString &filename); template<typename T> - T *findItem(QFxItem *parent, const QString &id, int index=0); + T *findItem(QFxItem *parent, const QString &id, int index=-1); }; tst_QFxLayouts::tst_QFxLayouts() @@ -197,16 +197,19 @@ QFxView *tst_QFxLayouts::createView(const QString &filename) } /* - Find an item with the specified id. If index is supplied then the + Find an item with the specified objectName. If index is supplied then the item must also evaluate the {index} expression equal to index */ template<typename T> -T *tst_QFxLayouts::findItem(QFxItem *parent, const QString &id, int index) +T *tst_QFxLayouts::findItem(QFxItem *parent, const QString &objectName, int index) { const QMetaObject &mo = T::staticMetaObject; - for (int i = 0; i < parent->children()->count(); ++i) { - QFxItem *item = parent->children()->at(i); - if (mo.cast(item) && (id.isEmpty() || item->id() == id)) { + for (int i = 0; i < parent->QGraphicsObject::children().count(); ++i) { + QFxItem *item = qobject_cast<QFxItem*>(parent->QGraphicsObject::children().at(i)); + if(!item) + continue; + //qDebug() << item << item->objectName(); + if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { if (index != -1) { QmlExpression e(qmlContext(item), "index", item); e.setTrackChange(false); @@ -216,7 +219,7 @@ T *tst_QFxLayouts::findItem(QFxItem *parent, const QString &id, int index) return static_cast<T*>(item); } } - item = findItem<T>(item, id, index); + item = findItem<T>(item, objectName, index); if (item) return static_cast<T*>(item); } diff --git a/tests/auto/declarative/listview/tst_listview.cpp b/tests/auto/declarative/listview/tst_listview.cpp index 8cf0a85..8bf9c8a 100644 --- a/tests/auto/declarative/listview/tst_listview.cpp +++ b/tests/auto/declarative/listview/tst_listview.cpp @@ -456,14 +456,14 @@ QFxView *tst_QFxListView::createView(const QString &filename) item must also evaluate the {index} expression equal to index */ template<typename T> -T *tst_QFxListView::findItem(QFxItem *parent, const QString &id, int index) +T *tst_QFxListView::findItem(QFxItem *parent, const QString &objectName, int index) { const QMetaObject &mo = T::staticMetaObject; qDebug() << parent->children()->count() << "children"; for (int i = 0; i < parent->children()->count(); ++i) { QFxItem *item = parent->children()->at(i); qDebug() << "try" << item; - if (mo.cast(item) && (id.isEmpty() || item->id() == id)) { + if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { if (index != -1) { QmlExpression e(qmlContext(item), "index", item); e.setTrackChange(false); @@ -473,7 +473,7 @@ T *tst_QFxListView::findItem(QFxItem *parent, const QString &id, int index) return static_cast<T*>(item); } } - item = findItem<T>(item, id, index); + item = findItem<T>(item, objectName, index); if (item) return static_cast<T*>(item); } diff --git a/tests/auto/declarative/pathview/data/pathview.qml b/tests/auto/declarative/pathview/data/pathview.qml index 5bf2085..7040e4c 100644 --- a/tests/auto/declarative/pathview/data/pathview.qml +++ b/tests/auto/declarative/pathview/data/pathview.qml @@ -12,7 +12,7 @@ Rect { height: 20 width: 60 color: "white" - pen.color: "black" + border.color: "black" Text { text: index } diff --git a/tests/auto/declarative/pathview/tst_pathview.cpp b/tests/auto/declarative/pathview/tst_pathview.cpp index 92890ba..9cae961 100644 --- a/tests/auto/declarative/pathview/tst_pathview.cpp +++ b/tests/auto/declarative/pathview/tst_pathview.cpp @@ -101,7 +101,7 @@ tst_QFxPathView::tst_QFxPathView() void tst_QFxPathView::items() { - QFxView *canvas = createView(SRCDIR "/data/pathview.xml"); + QFxView *canvas = createView(SRCDIR "/data/pathview.qml"); TestModel model; model.addItem("Fred", "12345"); @@ -133,7 +133,7 @@ void tst_QFxPathView::items() void tst_QFxPathView::pathMoved() { - QFxView *canvas = createView(SRCDIR "/data/pathview.xml"); + QFxView *canvas = createView(SRCDIR "/data/pathview.qml"); TestModel model; model.addItem("Ben", "12345"); @@ -176,7 +176,7 @@ void tst_QFxPathView::pathMoved() void tst_QFxPathView::limitedItems() { - QFxView *canvas = createView(SRCDIR "/data/pathview.xml"); + QFxView *canvas = createView(SRCDIR "/data/pathview.qml"); TestModel model; for(int i=0; i<100; i++) @@ -220,23 +220,23 @@ QFxView *tst_QFxPathView::createView(const QString &filename) QFile file(filename); file.open(QFile::ReadOnly); - QString xml = file.readAll(); - canvas->setQml(xml, filename); + QString qml = file.readAll(); + canvas->setQml(qml, filename); return canvas; } /* - Find an item with the specified id. If index is supplied then the + Find an item with the specified objectName. If index is supplied then the item must also evaluate the {index} expression equal to index */ template<typename T> -T *tst_QFxPathView::findItem(QFxItem *parent, const QString &id, int index) +T *tst_QFxPathView::findItem(QFxItem *parent, const QString &objectName, int index) { const QMetaObject &mo = T::staticMetaObject; for (int i = 0; i < parent->children()->count(); ++i) { QFxItem *item = parent->children()->at(i); - if (mo.cast(item) && (id.isEmpty() || item->id() == id)) { + if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { if (index != -1) { QmlExpression e(qmlContext(item), "index", item); e.setTrackChange(false); @@ -246,7 +246,7 @@ T *tst_QFxPathView::findItem(QFxItem *parent, const QString &id, int index) return static_cast<T*>(item); } } - item = findItem<T>(item, id, index); + item = findItem<T>(item, objectName, index); if (item) return static_cast<T*>(item); } diff --git a/tests/auto/declarative/repeater/tst_repeater.cpp b/tests/auto/declarative/repeater/tst_repeater.cpp index 0d3ec98..0e7c187 100644 --- a/tests/auto/declarative/repeater/tst_repeater.cpp +++ b/tests/auto/declarative/repeater/tst_repeater.cpp @@ -72,13 +72,13 @@ QFxView *tst_QFxRepeater::createView(const QString &filename) } template<typename T> -T *tst_QFxRepeater::findItem(QFxItem *parent, const QString &id) +T *tst_QFxRepeater::findItem(QFxItem *parent, const QString &objectName) { const QMetaObject &mo = T::staticMetaObject; - if (mo.cast(parent) && (id.isEmpty() || parent->id() == id)) + if (mo.cast(parent) && (objectName.isEmpty() || parent->objectName() == objectName)) return static_cast<T*>(parent); for (int i = 0; i < parent->children()->count(); ++i) { - QFxItem *item = findItem<T>(parent->children()->at(i), id); + QFxItem *item = findItem<T>(parent->children()->at(i), objectName); if (item) return static_cast<T*>(item); } |