summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2013-01-21 13:34:56 +0100
committerPierre Rossi <pierre.rossi@gmail.com>2013-11-01 13:57:44 +0100
commitfe7c20fbe3e4ada56cd9bc161e1e4376a1bd1019 (patch)
tree813b2e7822cb6fbc1a6786e563f3aec768b30d44 /src
parent70284d66f8bdbc39a9b53030a7624dfd5f7d15ba (diff)
downloadqtwebchannel-fe7c20fbe3e4ada56cd9bc161e1e4376a1bd1019.tar.gz
Clarify connections between webview and webchannel.
We register objects once after the webchannel has initialized. The web view URL on the other hand gets changed via property binding after the web channel's base url is set/modified. This hopefully fixes a race condition between the client-side HTML logic and the registering of objects on the host-side QML app. Change-Id: Ie83f7a415d9005e805a544f25287e51e75fb4dec Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/qwebchannel.cpp1
-rw-r--r--src/qwebchannel.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/qwebchannel.cpp b/src/qwebchannel.cpp
index ee03cf8..d51dd72 100644
--- a/src/qwebchannel.cpp
+++ b/src/qwebchannel.cpp
@@ -442,6 +442,7 @@ void QWebChannel::setMaxPort(int p)
void QWebChannel::onInitialized()
{
+ emit initialized();
emit baseUrlChanged(d->baseUrl);
}
diff --git a/src/qwebchannel.h b/src/qwebchannel.h
index c3f90d9..b564787 100644
--- a/src/qwebchannel.h
+++ b/src/qwebchannel.h
@@ -106,6 +106,7 @@ signals:
// To be able to access the object from QML, it has to be an explicit QObject* and not a subclass.
void execute(const QString& requestData, QObject* response);
void noPortAvailable();
+ void initialized();
public slots:
void broadcast(const QString& id, const QString& data);