summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/qtobject/qml/qtobject/main.qml4
-rw-r--r--src/qwebchannel.cpp1
-rw-r--r--src/qwebchannel.h1
3 files changed, 4 insertions, 2 deletions
diff --git a/examples/qtobject/qml/qtobject/main.qml b/examples/qtobject/qml/qtobject/main.qml
index 05591a8..2ca26ec 100644
--- a/examples/qtobject/qml/qtobject/main.qml
+++ b/examples/qtobject/qml/qtobject/main.qml
@@ -75,15 +75,15 @@ Rectangle {
}
}
- onBaseUrlChanged: publisher.registerObjects({"testObject1": testObject1, "testObject2": testObject2, "testObject3":testObject3})
+ onInitialized: publisher.registerObjects({"testObject1": testObject1, "testObject2": testObject2, "testObject3":testObject3});
}
width: 480
height: 800
WebView {
+ url: webChannel.baseUrl ? "index.html?webChannelBaseUrl=" + webChannel.baseUrl : "about:blank"
anchors.fill: parent
- url: "index.html?webChannelBaseUrl=" + webChannel.baseUrl
experimental.preferences.developerExtrasEnabled: true
}
}
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);