summaryrefslogtreecommitdiff
path: root/src/webchannel/qwebchannelsocket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webchannel/qwebchannelsocket.cpp')
-rw-r--r--src/webchannel/qwebchannelsocket.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/webchannel/qwebchannelsocket.cpp b/src/webchannel/qwebchannelsocket.cpp
index 84e6685..b3daf8f 100644
--- a/src/webchannel/qwebchannelsocket.cpp
+++ b/src/webchannel/qwebchannelsocket.cpp
@@ -48,11 +48,14 @@ QT_BEGIN_NAMESPACE
QWebChannelSocket::QWebChannelSocket(QObject *parent)
: QWebSocketServer(parent)
+ , m_messageHandler(Q_NULLPTR)
, m_useSecret(true)
, m_starting(false)
{
connect(this, SIGNAL(error(QAbstractSocket::SocketError)),
SLOT(socketError()));
+ connect(this, SIGNAL(textDataReceived(QString)),
+ SLOT(messageReceived(QString)));
}
void QWebChannelSocket::initLater()
@@ -100,4 +103,11 @@ void QWebChannelSocket::socketError()
emit failed(errorString());
}
+void QWebChannelSocket::messageReceived(const QString &message)
+{
+ if (m_messageHandler) {
+ m_messageHandler->handleMessage(message);
+ }
+}
+
QT_END_NAMESPACE