diff options
| author | Kaloyan Chehlarski <kaloyan.chehlarski@qt.io> | 2025-11-25 12:58:37 +0100 |
|---|---|---|
| committer | Michal Klocek <michal.klocek@qt.io> | 2025-12-01 16:02:53 +0100 |
| commit | 3aa448809c7e3f9631d30d9bbfc62c7933bc93f5 (patch) | |
| tree | 8f593153c03becdf22b2f90c39e7b2c781ed1d79 /src/webview/qwebviewloadrequest.h | |
| parent | 7721af5cb47fd2656124ffa9fe08faea44835463 (diff) | |
Make QWebViewLoadRequest a public class
Move LoadStatus enum from QWebView class to
QWebLoadRequest class.
Small adjustments to fix compile issues.
Task-number: QTBUG-131837
Change-Id: I79b6a48b0426b177133502f75fb34af9d2120e46
Reviewed-by: Moss Heim <moss.heim@qt.io>
Diffstat (limited to 'src/webview/qwebviewloadrequest.h')
| -rw-r--r-- | src/webview/qwebviewloadrequest.h | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/src/webview/qwebviewloadrequest.h b/src/webview/qwebviewloadrequest.h index 4e49673..aee9511 100644 --- a/src/webview/qwebviewloadrequest.h +++ b/src/webview/qwebviewloadrequest.h @@ -2,42 +2,49 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only // Qt-Security score:significant reason:default -#ifndef QWEBVIEWLOADREQUESTPRIVATE_H -#define QWEBVIEWLOADREQUESTPRIVATE_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// +#ifndef QWEBVIEWLOADREQUEST_H +#define QWEBVIEWLOADREQUEST_H #include <QtWebView/qwebview.h> + #include <QtCore/qstring.h> #include <QtCore/qurl.h> QT_BEGIN_NAMESPACE -class Q_WEBVIEW_EXPORT QWebViewLoadRequestPrivate +class Q_WEBVIEW_EXPORT QWebViewLoadRequest { -public: - QWebViewLoadRequestPrivate(); - QWebViewLoadRequestPrivate(const QUrl &url, - QWebView::LoadStatus status, - const QString &errorString); - ~QWebViewLoadRequestPrivate(); + Q_GADGET + Q_PROPERTY(QUrl url READ url CONSTANT) + Q_PROPERTY(LoadStatus status READ status CONSTANT) + Q_PROPERTY(QString errorString READ errorString CONSTANT) + Q_CLASSINFO("RegisterEnumClassesUnscoped", "false") +public: + enum class LoadStatus { + LoadStartedStatus, + LoadStoppedStatus, + LoadSucceededStatus, + LoadFailedStatus + }; + Q_ENUM(LoadStatus) + + QWebViewLoadRequest(); + QWebViewLoadRequest(const QUrl &url, LoadStatus status, const QString &errorString); + ~QWebViewLoadRequest(); + + QUrl url() const; + LoadStatus status() const; + QString errorString() const; + +private: QUrl m_url; - QWebView::LoadStatus m_status; + LoadStatus m_status; QString m_errorString; }; QT_END_NAMESPACE -Q_DECLARE_METATYPE(QWebViewLoadRequestPrivate) +Q_DECLARE_METATYPE(QWebViewLoadRequest) -#endif // QWEBVIEWLOADREQUESTPRIVATE_H +#endif // QWEBVIEWLOADREQUEST_H |
