diff options
author | Milian Wolff <milian.wolff@kdab.com> | 2017-08-07 23:24:57 +0200 |
---|---|---|
committer | Milian Wolff <milian.wolff@kdab.com> | 2017-08-08 20:55:01 +0000 |
commit | b5229df6a08a902b11a2fc9529af6385f4d985d5 (patch) | |
tree | 09c9b0ca5e16c317441ff62e2a5a5408ee64c423 /tests/auto/webchannel/tst_webchannel.h | |
parent | 01bd2b3ca88b42b9daac7cb00d196eb90d168570 (diff) | |
download | qtwebchannel-b5229df6a08a902b11a2fc9529af6385f4d985d5.tar.gz |
Do not crash on non-QVariant return types
Patch e354bdc5 introduced a regression that triggers a crash
in Qt 5.9 when returning a type that is not implicitly convertible
to QVariant, such as a QJsonValue, from an invoked method/slot.
This patch fixes this situation and adds proper unit test coverage.
Change-Id: Ib8cb0c96e7496bc8dc9a628245d7a44e4234aff0
Task-number: QTBUG-62045
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Kai Dohmen <psykai1993@googlemail.com>
Diffstat (limited to 'tests/auto/webchannel/tst_webchannel.h')
-rw-r--r-- | tests/auto/webchannel/tst_webchannel.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/auto/webchannel/tst_webchannel.h b/tests/auto/webchannel/tst_webchannel.h index aaacb5a..d2597e5 100644 --- a/tests/auto/webchannel/tst_webchannel.h +++ b/tests/auto/webchannel/tst_webchannel.h @@ -258,20 +258,21 @@ public: explicit TestWebChannel(QObject *parent = 0); virtual ~TestWebChannel(); +public slots: int readInt() const; - Q_INVOKABLE void setInt(int i); + void setInt(int i); bool readBool() const; - Q_INVOKABLE void setBool(bool b); + void setBool(bool b); double readDouble() const; - Q_INVOKABLE void setDouble(double d); + void setDouble(double d); QVariant readVariant() const; - Q_INVOKABLE void setVariant(const QVariant &v); + void setVariant(const QVariant &v); QJsonValue readJsonValue() const; - Q_INVOKABLE void setJsonValue(const QJsonValue &v); + void setJsonValue(const QJsonValue &v); QJsonObject readJsonObject() const; - Q_INVOKABLE void setJsonObject(const QJsonObject &v); + void setJsonObject(const QJsonObject &v); QJsonArray readJsonArray() const; - Q_INVOKABLE void setJsonArray(const QJsonArray &v); + void setJsonArray(const QJsonArray &v); signals: void lastIntChanged(); |