summaryrefslogtreecommitdiff
path: root/src/imports/webchannel/qmlwebchannel.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/webchannel/qmlwebchannel.h')
-rw-r--r--src/imports/webchannel/qmlwebchannel.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/imports/webchannel/qmlwebchannel.h b/src/imports/webchannel/qmlwebchannel.h
index 3610307..6bc7127 100644
--- a/src/imports/webchannel/qmlwebchannel.h
+++ b/src/imports/webchannel/qmlwebchannel.h
@@ -45,7 +45,6 @@
#include <qwebchannel.h>
#include "qmlwebchannelattached.h"
-#include "qwebchanneltransportinterface.h"
#include <QVector>
@@ -58,7 +57,7 @@ class QmlWebChannel : public QWebChannel
{
Q_OBJECT
- Q_PROPERTY( QQmlListProperty<QWebChannelTransportInterface> connections READ transports );
+ Q_PROPERTY( QQmlListProperty<QObject> transports READ transports );
Q_PROPERTY( QQmlListProperty<QObject> registeredObjects READ registeredObjects )
public:
@@ -68,7 +67,7 @@ public:
Q_INVOKABLE void registerObjects(const QVariantMap &objects);
QQmlListProperty<QObject> registeredObjects();
- QQmlListProperty<QWebChannelTransportInterface> transports();
+ QQmlListProperty<QObject> transports();
// TODO: remove this by replacing QML with C++ tests
Q_INVOKABLE bool test_clientIsIdle() const;
@@ -80,7 +79,6 @@ public:
private Q_SLOTS:
void objectIdChanged(const QString &newId);
- void transportDestroyed(QObject *transport);
private:
static void registeredObjects_append(QQmlListProperty<QObject> *prop, QObject *item);
@@ -88,14 +86,12 @@ private:
static QObject *registeredObjects_at(QQmlListProperty<QObject> *prop, int index);
static void registeredObjects_clear(QQmlListProperty<QObject> *prop);
- static void transports_append(QQmlListProperty<QWebChannelTransportInterface> *prop, QWebChannelTransportInterface *item);
- static int transports_count(QQmlListProperty<QWebChannelTransportInterface> *prop);
- static QWebChannelTransportInterface *transports_at(QQmlListProperty<QWebChannelTransportInterface> *prop, int index);
- static void transports_clear(QQmlListProperty<QWebChannelTransportInterface> *prop);
+ static void transports_append(QQmlListProperty<QObject> *prop, QObject *item);
+ static int transports_count(QQmlListProperty<QObject> *prop);
+ static QObject *transports_at(QQmlListProperty<QObject> *prop, int index);
+ static void transports_clear(QQmlListProperty<QObject> *prop);
QVector<QObject*> m_registeredObjects;
- // required as when the object is destroyed, we must still find the address of the base class somehow
- QHash<QObject*, QWebChannelTransportInterface*> m_connectedObjects;
};
QML_DECLARE_TYPE( QmlWebChannel )