diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-04-13 17:25:16 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-04-13 17:25:16 +0200 |
commit | 2dce0008ce53d27d281ad2dc00eb32d25ae5fc84 (patch) | |
tree | 55d97b68f56b78f3388cdaaa4ae69648b7057f68 /src/webenginequick | |
parent | 919dd97e835f469609a0710eb91f829a6d70e88c (diff) | |
parent | 8fe660ecbbe1f126ce0da694adff956ad7159870 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ia01415e5a44b1df9ed8b3966ff3b39a414b1563c
Diffstat (limited to 'src/webenginequick')
-rw-r--r-- | src/webenginequick/api/qquickwebengineview.cpp | 5 | ||||
-rw-r--r-- | src/webenginequick/api/qquickwebengineview_p.h | 6 | ||||
-rw-r--r-- | src/webenginequick/api/qtwebengineglobal.cpp | 3 |
3 files changed, 10 insertions, 4 deletions
diff --git a/src/webenginequick/api/qquickwebengineview.cpp b/src/webenginequick/api/qquickwebengineview.cpp index 5456219fa..494e26090 100644 --- a/src/webenginequick/api/qquickwebengineview.cpp +++ b/src/webenginequick/api/qquickwebengineview.cpp @@ -888,6 +888,11 @@ QQuickWebEngineView::QQuickWebEngineView(QQuickItem *parent) d->q_ptr = this; this->setActiveFocusOnTab(true); this->setFlags(QQuickItem::ItemIsFocusScope | QQuickItem::ItemAcceptsDrops); + + connect(action(WebAction::Back), &QQuickWebEngineAction::enabledChanged, + this, &QQuickWebEngineView::canGoBackChanged); + connect(action(WebAction::Forward), &QQuickWebEngineAction::enabledChanged, + this, &QQuickWebEngineView::canGoForwardChanged); } QQuickWebEngineView::~QQuickWebEngineView() diff --git a/src/webenginequick/api/qquickwebengineview_p.h b/src/webenginequick/api/qquickwebengineview_p.h index bb89d23bb..df5880e73 100644 --- a/src/webenginequick/api/qquickwebengineview_p.h +++ b/src/webenginequick/api/qquickwebengineview_p.h @@ -103,8 +103,8 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem { Q_PROPERTY(bool loading READ isLoading NOTIFY loadingChanged FINAL) Q_PROPERTY(int loadProgress READ loadProgress NOTIFY loadProgressChanged FINAL) Q_PROPERTY(QString title READ title NOTIFY titleChanged FINAL) - Q_PROPERTY(bool canGoBack READ canGoBack NOTIFY urlChanged FINAL) - Q_PROPERTY(bool canGoForward READ canGoForward NOTIFY urlChanged FINAL) + Q_PROPERTY(bool canGoBack READ canGoBack NOTIFY canGoBackChanged FINAL) + Q_PROPERTY(bool canGoForward READ canGoForward NOTIFY canGoForwardChanged FINAL) Q_PROPERTY(bool isFullScreen READ isFullScreen NOTIFY isFullScreenChanged REVISION 1 FINAL) Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor NOTIFY zoomFactorChanged REVISION 1 FINAL) Q_PROPERTY(QQuickWebEngineProfile *profile READ profile WRITE setProfile NOTIFY profileChanged FINAL REVISION 1) @@ -570,6 +570,8 @@ Q_SIGNALS: Q_REVISION(10) void recommendedStateChanged(LifecycleState state); Q_REVISION(10) void findTextFinished(const QWebEngineFindTextResult &result); Q_REVISION(11) void renderProcessPidChanged(qint64 pid); + Q_REVISION(11) void canGoBackChanged(); + Q_REVISION(11) void canGoForwardChanged(); #if QT_CONFIG(webenginequick_testsupport) void testSupportChanged(); diff --git a/src/webenginequick/api/qtwebengineglobal.cpp b/src/webenginequick/api/qtwebengineglobal.cpp index 825805888..7d2b91e90 100644 --- a/src/webenginequick/api/qtwebengineglobal.cpp +++ b/src/webenginequick/api/qtwebengineglobal.cpp @@ -73,8 +73,7 @@ namespace QtWebEngine { */ void initialize() { - QCoreApplication *app = QCoreApplication::instance(); - if (app) { + if (!QCoreApplication::startingUp()) { qWarning("QtWebEngine::initialize() called with QCoreApplication object already created and should be call before. "\ "This is depreciated and may fail in the future."); QtWebEngineCore::initialize(); |