Revert "Add QObject::objectNameChanged(const QString &objectName) signal"

This reverts commit ba635d7e74.

Breaks tests in declarative:
tst_qdeclarativeecmascript::deleteLater
tst_qquickvisualdatamodel::objectListModel

Change-Id: I467b45109332e66fc62f3de00f376b1b88ab19ca
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
This commit is contained in:
Martin Jones 2011-12-02 14:28:00 +10:00 committed by Qt by Nokia
parent 6534898cc6
commit 9b17557f3b
4 changed files with 23 additions and 29 deletions

View File

@ -1096,21 +1096,14 @@ QString QObject::objectName() const
void QObject::setObjectName(const QString &name)
{
Q_D(QObject);
if (d->objectName != name) {
d->objectName = name;
if (d->declarativeData)
d->declarativeData->objectNameChanged(d->declarativeData, this);
emit objectNameChanged(d->objectName);
}
bool objectNameChanged = d->declarativeData && d->objectName != name;
d->objectName = name;
if (objectNameChanged)
d->declarativeData->objectNameChanged(d->declarativeData, this);
}
/*! \fn void QObject::objectNameChanged(const QString &objectName)
This signal is emitted after the object's name has been changed. The new object name is passed as \a objectName.
\sa QObject::objectName
*/
/*!
\fn bool QObject::isWidgetType() const

View File

@ -115,7 +115,7 @@ public:
class Q_CORE_EXPORT QObject
{
Q_OBJECT
Q_PROPERTY(QString objectName READ objectName WRITE setObjectName NOTIFY objectNameChanged)
Q_PROPERTY(QString objectName READ objectName WRITE setObjectName)
Q_DECLARE_PRIVATE(QObject)
public:
@ -313,7 +313,6 @@ public:
Q_SIGNALS:
void destroyed(QObject * = 0);
void objectNameChanged(const QString &objectName);
public:
inline QObject *parent() const { return d_ptr->parent; }

View File

@ -3487,6 +3487,7 @@ void tst_QObject::isSignalConnected()
QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig15()")));
QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig29()")));
QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig60()")));
QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig61()")));
#endif
QObject::connect(&o, SIGNAL(sig00()), &o, SIGNAL(sig69()));
@ -3541,6 +3542,7 @@ void tst_QObject::isSignalConnected()
QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig21()")));
QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig25()")));
QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig55()")));
QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig61()")));
#endif
emit o.sig00();

View File

@ -1091,15 +1091,15 @@ void tst_Moc::invokable()
{
{
const QMetaObject &mobj = InvokableBeforeReturnType::staticMetaObject;
QCOMPARE(mobj.methodCount(), 6);
QVERIFY(mobj.method(5).signature() == QByteArray("foo()"));
QCOMPARE(mobj.methodCount(), 5);
QVERIFY(mobj.method(4).signature() == QByteArray("foo()"));
}
{
const QMetaObject &mobj = InvokableBeforeInline::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
QVERIFY(mobj.method(5).signature() == QByteArray("foo()"));
QVERIFY(mobj.method(6).signature() == QByteArray("bar()"));
QCOMPARE(mobj.methodCount(), 6);
QVERIFY(mobj.method(4).signature() == QByteArray("foo()"));
QVERIFY(mobj.method(5).signature() == QByteArray("bar()"));
}
}
@ -1107,23 +1107,23 @@ void tst_Moc::singleFunctionKeywordSignalAndSlot()
{
{
const QMetaObject &mobj = SingleFunctionKeywordBeforeReturnType::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
QVERIFY(mobj.method(5).signature() == QByteArray("mySignal()"));
QVERIFY(mobj.method(6).signature() == QByteArray("mySlot()"));
QCOMPARE(mobj.methodCount(), 6);
QVERIFY(mobj.method(4).signature() == QByteArray("mySignal()"));
QVERIFY(mobj.method(5).signature() == QByteArray("mySlot()"));
}
{
const QMetaObject &mobj = SingleFunctionKeywordBeforeInline::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
QVERIFY(mobj.method(5).signature() == QByteArray("mySignal()"));
QVERIFY(mobj.method(6).signature() == QByteArray("mySlot()"));
QCOMPARE(mobj.methodCount(), 6);
QVERIFY(mobj.method(4).signature() == QByteArray("mySignal()"));
QVERIFY(mobj.method(5).signature() == QByteArray("mySlot()"));
}
{
const QMetaObject &mobj = SingleFunctionKeywordAfterInline::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
QVERIFY(mobj.method(5).signature() == QByteArray("mySignal()"));
QVERIFY(mobj.method(6).signature() == QByteArray("mySlot()"));
QCOMPARE(mobj.methodCount(), 6);
QVERIFY(mobj.method(4).signature() == QByteArray("mySignal()"));
QVERIFY(mobj.method(5).signature() == QByteArray("mySlot()"));
}
}