summaryrefslogtreecommitdiffstats
path: root/src/webenginequick
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-04-13 17:25:16 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-04-13 17:25:16 +0200
commit2dce0008ce53d27d281ad2dc00eb32d25ae5fc84 (patch)
tree55d97b68f56b78f3388cdaaa4ae69648b7057f68 /src/webenginequick
parent919dd97e835f469609a0710eb91f829a6d70e88c (diff)
parent8fe660ecbbe1f126ce0da694adff956ad7159870 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'src/webenginequick')
-rw-r--r--src/webenginequick/api/qquickwebengineview.cpp5
-rw-r--r--src/webenginequick/api/qquickwebengineview_p.h6
-rw-r--r--src/webenginequick/api/qtwebengineglobal.cpp3
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();