summaryrefslogtreecommitdiff
path: root/tests/auto/webchannel/tst_webchannel.cpp
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2014-07-03 19:17:02 +0200
committerMilian Wolff <milian.wolff@kdab.com>2014-07-15 11:31:48 +0200
commit003596fad52690127afca0d7025b62bad7fd013e (patch)
tree7b68f95ce3a519018b309990f85bf7e044307fe9 /tests/auto/webchannel/tst_webchannel.cpp
parent125c5f7dc270ab58e5f876cf8bc8aaf56d9e8f1b (diff)
downloadqtwebchannel-003596fad52690127afca0d7025b62bad7fd013e.tar.gz
Make the QWebChannel QML API publically accessible.
This is required for proper QtWebKit/QtWebEngine integration, as otherwise these modules would have to redo a lot of the QtWebChannel QML API. Furthermore, without this, we could not use the WebChannel.id attached property everywhere, independent of the web browser technology. Change-Id: I032a9326841d505c2f77959a240bbfc71e94b6e8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'tests/auto/webchannel/tst_webchannel.cpp')
-rw-r--r--tests/auto/webchannel/tst_webchannel.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/auto/webchannel/tst_webchannel.cpp b/tests/auto/webchannel/tst_webchannel.cpp
index 10baaa3..632d055 100644
--- a/tests/auto/webchannel/tst_webchannel.cpp
+++ b/tests/auto/webchannel/tst_webchannel.cpp
@@ -83,7 +83,7 @@ void TestWebChannel::testRegisterObjects()
QHash<QString, QObject*> objects;
objects[QStringLiteral("plain")] = &plain;
objects[QStringLiteral("channel")] = &channel;
- objects[QStringLiteral("publisher")] = channel.d->publisher;
+ objects[QStringLiteral("publisher")] = channel.d_func()->publisher;
objects[QStringLiteral("test")] = this;
channel.registerObjects(objects);
@@ -95,7 +95,7 @@ void TestWebChannel::testInfoForObject()
obj.setObjectName("myTestObject");
QWebChannel channel;
- const QJsonObject info = channel.d->publisher->classInfoForObject(&obj);
+ const QJsonObject info = channel.d_func()->publisher->classInfoForObject(&obj);
QCOMPARE(info.keys(), QStringList() << "enums" << "methods" << "properties" << "signals");
@@ -227,19 +227,19 @@ void TestWebChannel::testInvokeMethodConversion()
{
int method = metaObject()->indexOfMethod("setInt(int)");
QVERIFY(method != -1);
- QVERIFY(!channel.d->publisher->invokeMethod(this, method, args, QJsonValue()).isEmpty());
+ QVERIFY(!channel.d_func()->publisher->invokeMethod(this, method, args, QJsonValue()).isEmpty());
QCOMPARE(m_lastInt, args.at(0).toInt());
}
{
int method = metaObject()->indexOfMethod("setDouble(double)");
QVERIFY(method != -1);
- QVERIFY(!channel.d->publisher->invokeMethod(this, method, args, QJsonValue()).isEmpty());
+ QVERIFY(!channel.d_func()->publisher->invokeMethod(this, method, args, QJsonValue()).isEmpty());
QCOMPARE(m_lastDouble, args.at(0).toDouble());
}
{
int method = metaObject()->indexOfMethod("setVariant(QVariant)");
QVERIFY(method != -1);
- QVERIFY(!channel.d->publisher->invokeMethod(this, method, args, QJsonValue()).isEmpty());
+ QVERIFY(!channel.d_func()->publisher->invokeMethod(this, method, args, QJsonValue()).isEmpty());
QCOMPARE(m_lastVariant, args.at(0).toVariant());
}
}
@@ -265,7 +265,7 @@ void TestWebChannel::benchClassInfo()
QBENCHMARK {
foreach (const QObject *object, objects) {
- channel.d->publisher->classInfoForObject(object);
+ channel.d_func()->publisher->classInfoForObject(object);
}
}
}
@@ -278,7 +278,7 @@ void TestWebChannel::benchInitializeClients()
QObject parent;
channel.registerObjects(createObjects(&parent));
- QMetaObjectPublisher *publisher = channel.d->publisher;
+ QMetaObjectPublisher *publisher = channel.d_func()->publisher;
QBENCHMARK {
publisher->initializeClients();
@@ -302,15 +302,15 @@ void TestWebChannel::benchPropertyUpdates()
}
channel.registerObjects(objects);
- channel.d->publisher->initializeClients();
+ channel.d_func()->publisher->initializeClients();
QBENCHMARK {
foreach (BenchObject *obj, objectList) {
obj->change();
}
- channel.d->publisher->clientIsIdle = true;
- channel.d->publisher->sendPendingPropertyUpdates();
+ channel.d_func()->publisher->clientIsIdle = true;
+ channel.d_func()->publisher->sendPendingPropertyUpdates();
}
}