diff options
author | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-11-09 15:23:32 +0100 |
---|---|---|
committer | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-11-12 12:36:15 +0000 |
commit | 70a376d73718cc4ff8d96f6761b8c1896ca25c23 (patch) | |
tree | 27111f884d6c8dcb04f0d0f52217413b99452b44 /src/webenginewidgets/api/qwebenginefullscreenrequest.h | |
parent | 93745b5452c2ec69c04be2a2043c0937327ee556 (diff) | |
download | qtwebengine-70a376d73718cc4ff8d96f6761b8c1896ca25c23.tar.gz |
Make QWebEngineFullScreenRequest const correct
Let QWebEngineFullScreenRequest be logically const-correct. It feels
weird to be allowed to call "accept()" or "reject()" on a constant
object.
Also allow the user to copy the request, but check whether the
page is still valid in the implementations of accept(), reject().
Change-Id: Ibf139a126734fc8e2db68ec26dc8f24cd4438942
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/webenginewidgets/api/qwebenginefullscreenrequest.h')
-rw-r--r-- | src/webenginewidgets/api/qwebenginefullscreenrequest.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/webenginewidgets/api/qwebenginefullscreenrequest.h b/src/webenginewidgets/api/qwebenginefullscreenrequest.h index c6768f4d6..26f7247e0 100644 --- a/src/webenginewidgets/api/qwebenginefullscreenrequest.h +++ b/src/webenginewidgets/api/qwebenginefullscreenrequest.h @@ -38,26 +38,25 @@ #define QWEBENGINEFULLSCREENREQUEST_H #include <qtwebenginewidgetsglobal.h> -#include <qwebenginepage.h> -#include <QtCore/qurl.h> +#include <qurl.h> +#include <qpointer.h> QT_BEGIN_NAMESPACE -class QWebEnginePagePrivate; +class QWebEnginePage; class QWEBENGINEWIDGETS_EXPORT QWebEngineFullScreenRequest { Q_GADGET Q_PROPERTY(bool toggleOn READ toggleOn) Q_PROPERTY(QUrl origin READ origin) public: - Q_INVOKABLE void reject() const; - Q_INVOKABLE void accept() const; + Q_INVOKABLE void reject(); + Q_INVOKABLE void accept(); bool toggleOn() const { return m_toggleOn; } const QUrl &origin() const { return m_origin; } private: - Q_DISABLE_COPY(QWebEngineFullScreenRequest) - QWebEngineFullScreenRequest(QWebEnginePagePrivate *pagePrivate, const QUrl &origin, bool toggleOn); - QWebEnginePagePrivate *m_pagePrivate; + QWebEngineFullScreenRequest(QWebEnginePage *page, const QUrl &origin, bool toggleOn); + QPointer<QWebEnginePage> m_page; const QUrl m_origin; const bool m_toggleOn; friend class QWebEnginePagePrivate; |