summaryrefslogtreecommitdiffstats
path: root/src/webengine/api/qquickwebengineview.cpp
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2018-11-28 14:09:50 +0100
committerSzabolcs David <davidsz@inf.u-szeged.hu>2018-11-29 15:47:14 +0000
commitf7110be2c88596814d1210d8fe1af9c501f9555e (patch)
tree8849a713263be9a1b362937cb5bf1ed9fad9d269 /src/webengine/api/qquickwebengineview.cpp
parent35ee29eb348b4629f47a6b700f9e2c356265aeba (diff)
Avoid binding loops caused by default context menu
When a WebEngineAction is tied to a UI element and a context menu request modifies its enabled state, the users get a warning: 'Binding loop detected for property "enabled"' Avoid triggering the action's notifier signal when the default context menu is being built. Change-Id: Ie23087f0b879399cf1cb88c44a42cd0be537a750 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/webengine/api/qquickwebengineview.cpp')
-rw-r--r--src/webengine/api/qquickwebengineview.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index d9667a643..b9ae06aeb 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -2225,7 +2225,8 @@ void QQuickContextMenuBuilder::addMenuItem(ContextMenuItem menuItem)
m_view->d_ptr->ui()->addMenuSeparator(m_menu);
return;
}
- action->d_ptr->setEnabled(isMenuItemEnabled(menuItem));
+ // Set enabled property directly with avoiding binding loops caused by its notifier signal.
+ action->d_ptr->m_enabled = isMenuItemEnabled(menuItem);
m_view->d_ptr->ui()->addMenuItem(action, m_menu);
}