1// Copyright (C) 2015 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qquickwebviewloadrequest_p.h"
5#include <QtWebView/private/qwebviewloadrequest_p.h>
6
7QT_BEGIN_NAMESPACE
8
9/*!
10 \qmltype WebViewLoadRequest
11 //! \instantiates QQuickWebViewLoadRequest
12 \inqmlmodule QtWebView
13
14 \brief A utility type for \l {WebView}'s \l {WebView::}{loadingChanged()} signal.
15
16 The WebViewLoadRequest type contains load status information for the requested URL.
17
18 \sa {WebView::loadingChanged()}{WebView.loadingChanged()}
19*/
20QQuickWebViewLoadRequest::QQuickWebViewLoadRequest(const QWebViewLoadRequestPrivate &d)
21 : d_ptr(new QWebViewLoadRequestPrivate(d))
22{
23}
24
25QQuickWebViewLoadRequest::~QQuickWebViewLoadRequest() { }
26
27/*!
28 \qmlproperty url QtWebView::WebViewLoadRequest::url
29 \readonly
30
31 The URL of the load request.
32 */
33QUrl QQuickWebViewLoadRequest::url() const
34{
35 Q_D(const QWebViewLoadRequest);
36 return d->m_url;
37}
38
39/*!
40 \qmlproperty enumeration WebViewLoadRequest::status
41 \readonly
42
43 This enumeration represents the load status of a web page load request.
44
45 \value WebView.LoadStartedStatus The page is currently loading.
46 \value WebView.LoadSucceededStatus The page was loaded successfully.
47 \value WebView.LoadFailedStatus The page could not be loaded.
48
49 \sa {WebView::loadingChanged()}{WebView.loadingChanged}
50*/
51QQuickWebView::LoadStatus QQuickWebViewLoadRequest::status() const
52{
53 Q_D(const QWebViewLoadRequest);
54 return QQuickWebView::LoadStatus(d->m_status);
55}
56
57/*!
58 \qmlproperty string QtWebView::WebViewLoadRequest::errorString
59 \readonly
60
61 Holds the error message if the load request failed.
62*/
63QString QQuickWebViewLoadRequest::errorString() const
64{
65 Q_D(const QWebViewLoadRequest);
66 return d->m_errorString;
67}
68
69QT_END_NAMESPACE
70

source code of qtwebview/src/quick/qquickwebviewloadrequest.cpp