diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2023-08-08 10:17:16 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-08-14 09:04:36 +0000 |
commit | 692bf646a8756bc60026beab9b6ab39a1e2fe4aa (patch) | |
tree | afe2f1f05e837ab9949e1e176caf944ff3d7562c | |
parent | 7ec7028c48312d280a094f7ab609fc3714f831b3 (diff) |
Prevent QWebEngineCertificateError from being exported twice to QML
We need to export the type as a value type, and also export its enums
in a namespace. This resulted in duplicated entries in the qmltypes
file, which confuses Qt Design Studio.
Fix it by introducing a derived class, and using it for exporting the
enums.
Fixes: QTBUG-115365
Change-Id: I5900f4f76fb6357c9262496cc3cc01b276387e46
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit df4121886dfa11cf90e74c72b1121a96462726bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/webenginequick/api/qquickwebengineforeigntypes_p.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/webenginequick/api/qquickwebengineforeigntypes_p.h b/src/webenginequick/api/qquickwebengineforeigntypes_p.h index 1591e596f..08fac43d5 100644 --- a/src/webenginequick/api/qquickwebengineforeigntypes_p.h +++ b/src/webenginequick/api/qquickwebengineforeigntypes_p.h @@ -53,10 +53,17 @@ struct ForeignWebEngineLoadingInfo QML_UNCREATABLE("") }; +// To prevent the same type from being exported twice into qmltypes +// (for value type and for the enums) +struct QWebEngineCertificateErrorDerived : public QWebEngineCertificateError +{ + Q_GADGET +}; + namespace ForeignWebEngineCertificateErrorNamespace { Q_NAMESPACE - QML_FOREIGN_NAMESPACE(QWebEngineCertificateError) + QML_FOREIGN_NAMESPACE(QWebEngineCertificateErrorDerived) QML_NAMED_ELEMENT(WebEngineCertificateError) QML_ADDED_IN_VERSION(1, 1) QML_EXTRA_VERSION(2, 0) |