summaryrefslogtreecommitdiff
path: root/src/webchannel/qmetaobjectpublisher_p.h
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2014-03-21 16:15:47 +0100
committerPierre Rossi <pierre.rossi@gmail.com>2014-07-04 12:37:29 +0200
commit856dc072acb649be03e02ac64c81015d3f2675c2 (patch)
tree649985d553d6ea92360a66ca291af91c1114596e /src/webchannel/qmetaobjectpublisher_p.h
parent9f78e0985d2f4fdc2588be57c5f25afdd59c6365 (diff)
downloadqtwebchannel-856dc072acb649be03e02ac64c81015d3f2675c2.tar.gz
Refactor code to use QWebChannelAbstractTransport and QtWebSockets.
This is a quite big changeset, but necessary to get the roadmap implemented that was discussed at QtCS. With this patchset landed, the QWebChannel does not depend on QtWebKit anymore, not even for the tests. Rather, we will introduce the dependency in the other way (i.e. QtWebKit will optionally use QtWebChannel if available). For the pure Qt/C++ use-case, we ship a utility implementation of a QWebChannelAbstractTransport that uses a QWebSocket for the server-client communication. This way, we can get rid of the custom WebSocket implementation. The tests are refactored to run the qwebchannel.js code directly inside QML. Integration tests for QtWebKit/QtWebEngine as well as examples will be added to these repositories. Change-Id: Icc1c1c5918ec46e31d5070937c14c4ca25a3e2d6 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Diffstat (limited to 'src/webchannel/qmetaobjectpublisher_p.h')
-rw-r--r--src/webchannel/qmetaobjectpublisher_p.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/webchannel/qmetaobjectpublisher_p.h b/src/webchannel/qmetaobjectpublisher_p.h
index 49b3ed0..dda18ae 100644
--- a/src/webchannel/qmetaobjectpublisher_p.h
+++ b/src/webchannel/qmetaobjectpublisher_p.h
@@ -51,16 +51,14 @@
#include <QPointer>
#include "qwebchannelglobal.h"
-#include "qwebchanneltransportinterface.h"
QT_BEGIN_NAMESPACE
class QWebChannel;
-
-class Q_WEBCHANNEL_EXPORT QMetaObjectPublisher : public QObject, public QWebChannelMessageHandlerInterface
+class Q_WEBCHANNEL_EXPORT QMetaObjectPublisher : public QObject
{
Q_OBJECT
- Q_INTERFACES(QWebChannelMessageHandlerInterface)
+
public:
explicit QMetaObjectPublisher(QWebChannel *webChannel);
virtual ~QMetaObjectPublisher();
@@ -161,13 +159,14 @@ public:
*/
void setBlockUpdates(bool block);
+Q_SIGNALS:
+ void blockUpdatesChanged(bool block);
+
+public Q_SLOTS:
/**
* Parse the message as JSON and if it succeeds, call handleRequest with the obtained JSON object.
*/
- void handleMessage(const QString &message, QWebChannelTransportInterface* transport, int clientId) Q_DECL_OVERRIDE;
-
-Q_SIGNALS:
- void blockUpdatesChanged(bool block);
+ void handleMessage(const QString &message);
protected:
void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;