diff options
author | Olivier De Cannière <[email protected]> | 2025-08-06 09:33:01 +0200 |
---|---|---|
committer | Olivier De Cannière <[email protected]> | 2025-08-15 07:37:25 +0000 |
commit | 22bfc520037f2dc045585ec1031e7104acf8c590 (patch) | |
tree | 314c72c8d2ff51e8c8578dd205390f0a7f9f09d8 | |
parent | 816d94b1fc1509faad39215fc9448f3a1ac42fd9 (diff) |
WebEngineQuick: Expose QWebEngineClientHints to QML
The type already had registration macros but because the header was
added to a non-QML module these didn't come into effect.
Add a foreign type to register it properly.
Task-number: QTBUG-138589
Pick-to: 6.10 6.9
Change-Id: I5a960cf77b71ff4f2b7ddc03b1583029b86d84bc
Reviewed-by: Ulf Hermann <[email protected]>
-rw-r--r-- | src/core/api/qwebengineclienthints.h | 5 | ||||
-rw-r--r-- | src/webenginequick/api/qquickwebengineforeigntypes_p.h | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/core/api/qwebengineclienthints.h b/src/core/api/qwebengineclienthints.h index ef9c59ed9..15be5acef 100644 --- a/src/core/api/qwebengineclienthints.h +++ b/src/core/api/qwebengineclienthints.h @@ -10,7 +10,6 @@ #include <QtCore/qobject.h> #include <QtCore/qpointer.h> #include <QtCore/qvariantmap.h> -#include <QtQml/qqmlregistration.h> namespace QtWebEngineCore { class ProfileAdapter; @@ -35,10 +34,6 @@ class Q_WEBENGINECORE_EXPORT QWebEngineClientHints : public QObject Q_PROPERTY(bool isAllClientHintsEnabled READ isAllClientHintsEnabled WRITE setAllClientHintsEnabled FINAL) public: - QML_NAMED_ELEMENT(WebEngineClientHints) - QML_UNCREATABLE("") - QML_ADDED_IN_VERSION(6, 8) - ~QWebEngineClientHints(); QString arch() const; diff --git a/src/webenginequick/api/qquickwebengineforeigntypes_p.h b/src/webenginequick/api/qquickwebengineforeigntypes_p.h index 72f6d05d6..be10af081 100644 --- a/src/webenginequick/api/qquickwebengineforeigntypes_p.h +++ b/src/webenginequick/api/qquickwebengineforeigntypes_p.h @@ -34,6 +34,7 @@ #include <QtWebEngineCore/qwebenginewebauthuxrequest.h> #include <QtWebEngineCore/qwebenginepermission.h> #include <QtWebEngineCore/qwebenginedesktopmediarequest.h> +#include <QtWebEngineCore/qwebengineclienthints.h> QT_BEGIN_NAMESPACE @@ -274,6 +275,15 @@ struct ForeignWebEngineDesktopMediaRequest QML_ADDED_IN_VERSION(6, 10) }; +struct ForeignWebEngineClientHints : public QObject +{ + Q_OBJECT + QML_FOREIGN(QWebEngineClientHints) + QML_NAMED_ELEMENT(WebEngineClientHints) + QML_ADDED_IN_VERSION(6, 8) + QML_UNCREATABLE("") +}; + QT_END_NAMESPACE #endif // QQUICKWEBENGINEFOREIGNTYPES_H |