summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-02-15 21:17:21 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-02-15 21:17:21 +0100
commita9bad172f62fe1dda280df5477a8b7c1bd57690d (patch)
treea22948b7300a57902a6e46d5346104e32c898e64
parent9507cdc31ff6778cba77764bb0991e538c493a9e (diff)
parente777ff1f88e58c1b47044ac83aafa8ccafa3840f (diff)
downloadqtwebchannel-a9bad172f62fe1dda280df5477a8b7c1bd57690d.tar.gz
Merge remote-tracking branch 'origin/5.6' into 5.7v5.7.0-alpha1
Conflicts: .qmake.conf Change-Id: I42bfb38e5a9bf03b43636309fe9e29e8d772bb06
-rw-r--r--examples/webchannel/standalone/index.html6
-rw-r--r--examples/webchannel/standalone/main.cpp10
-rw-r--r--src/webchannel/doc/qtwebchannel.qdocconf2
-rw-r--r--src/webchannel/qmetaobjectpublisher_p.h11
-rw-r--r--src/webchannel/qqmlwebchannelattached_p.h11
-rw-r--r--src/webchannel/qwebchannel_p.h11
-rw-r--r--src/webchannel/signalhandler_p.h11
-rw-r--r--src/webchannel/variantargument_p.h11
8 files changed, 68 insertions, 5 deletions
diff --git a/examples/webchannel/standalone/index.html b/examples/webchannel/standalone/index.html
index 778a502..b5a9a49 100644
--- a/examples/webchannel/standalone/index.html
+++ b/examples/webchannel/standalone/index.html
@@ -11,7 +11,11 @@
output.innerHTML = output.innerHTML + message + "\n";
}
window.onload = function() {
- var baseUrl = (/[?&]webChannelBaseUrl=([A-Za-z0-9\-:/\.]+)/.exec(location.search)[1]);
+ if (location.search != "")
+ var baseUrl = (/[?&]webChannelBaseUrl=([A-Za-z0-9\-:/\.]+)/.exec(location.search)[1]);
+ else
+ var baseUrl = "ws://localhost:12345";
+
output("Connecting to WebSocket server at " + baseUrl + ".");
var socket = new WebSocket(baseUrl);
diff --git a/examples/webchannel/standalone/main.cpp b/examples/webchannel/standalone/main.cpp
index 921aa4c..b53e9a6 100644
--- a/examples/webchannel/standalone/main.cpp
+++ b/examples/webchannel/standalone/main.cpp
@@ -55,8 +55,8 @@
#include <QVariantMap>
#include <QDesktopServices>
#include <QUrl>
-#include <QDebug>
-
+#include <QDir>
+#include <QFileInfo>
#include <QtWebSockets/QWebSocketServer>
#include "../shared/websocketclientwrapper.h"
@@ -128,6 +128,11 @@ int main(int argc, char** argv)
{
QApplication app(argc, argv);
+ QFileInfo jsFileInfo(QDir::currentPath() + "/qwebchannel.js");
+
+ if (!jsFileInfo.exists())
+ QFile::copy(":/qtwebchannel/qwebchannel.js",jsFileInfo.absoluteFilePath());
+
// setup the QWebSocketServer
QWebSocketServer server(QStringLiteral("QWebChannel Standalone Example Server"), QWebSocketServer::NonSecureMode);
if (!server.listen(QHostAddress::LocalHost, 12345)) {
@@ -149,7 +154,6 @@ int main(int argc, char** argv)
// open a browser window with the client HTML page
QUrl url = QUrl::fromLocalFile(BUILD_DIR "/index.html");
- url.setQuery(QStringLiteral("webChannelBaseUrl=") + server.serverUrl().toString());
QDesktopServices::openUrl(url);
dialog.displayMessage(QObject::tr("Initialization complete, opening browser at %1.").arg(url.toDisplayString()));
diff --git a/src/webchannel/doc/qtwebchannel.qdocconf b/src/webchannel/doc/qtwebchannel.qdocconf
index cfb47e4..fc036d2 100644
--- a/src/webchannel/doc/qtwebchannel.qdocconf
+++ b/src/webchannel/doc/qtwebchannel.qdocconf
@@ -4,7 +4,7 @@ project = QtWebChannel
description = Qt WebChannel Reference Documentation
version = $QT_VERSION
-examplesinstallpath = webchannel
+examplesinstallpath = qtwebchannel/webchannel
qhp.projects = QtWebChannel
diff --git a/src/webchannel/qmetaobjectpublisher_p.h b/src/webchannel/qmetaobjectpublisher_p.h
index dfe5b89..f5109b6 100644
--- a/src/webchannel/qmetaobjectpublisher_p.h
+++ b/src/webchannel/qmetaobjectpublisher_p.h
@@ -40,6 +40,17 @@
#ifndef QMETAOBJECTPUBLISHER_P_H
#define QMETAOBJECTPUBLISHER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "variantargument_p.h"
#include "signalhandler_p.h"
diff --git a/src/webchannel/qqmlwebchannelattached_p.h b/src/webchannel/qqmlwebchannelattached_p.h
index 18f3d8a..403b205 100644
--- a/src/webchannel/qqmlwebchannelattached_p.h
+++ b/src/webchannel/qqmlwebchannelattached_p.h
@@ -40,6 +40,17 @@
#ifndef QQMLWEBCHANNELATTACHED_H
#define QQMLWEBCHANNELATTACHED_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QObject>
#include "qwebchannelglobal.h"
diff --git a/src/webchannel/qwebchannel_p.h b/src/webchannel/qwebchannel_p.h
index 1c82d86..28893ad 100644
--- a/src/webchannel/qwebchannel_p.h
+++ b/src/webchannel/qwebchannel_p.h
@@ -40,6 +40,17 @@
#ifndef QWEBCHANNEL_P_H
#define QWEBCHANNEL_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qwebchannelglobal.h"
#include <private/qobject_p.h>
diff --git a/src/webchannel/signalhandler_p.h b/src/webchannel/signalhandler_p.h
index 01941df..b6c316b 100644
--- a/src/webchannel/signalhandler_p.h
+++ b/src/webchannel/signalhandler_p.h
@@ -40,6 +40,17 @@
#ifndef SIGNALHANDLER_H
#define SIGNALHANDLER_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QObject>
#include <QHash>
#include <QVector>
diff --git a/src/webchannel/variantargument_p.h b/src/webchannel/variantargument_p.h
index af812a8..263a742 100644
--- a/src/webchannel/variantargument_p.h
+++ b/src/webchannel/variantargument_p.h
@@ -40,6 +40,17 @@
#ifndef VARIANTARGUMENT_H
#define VARIANTARGUMENT_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QVariant>
QT_BEGIN_NAMESPACE