diff --git a/examples/webenginewidgets/browser/browserapplication.cpp b/examples/webenginewidgets/browser/browserapplication.cpp index 9ea9fbfcf5b79989a15c67e5114e39b45808923f..14023f6e74749103481a9b78ecf1e7e4541a1eff 100644 --- a/examples/webenginewidgets/browser/browserapplication.cpp +++ b/examples/webenginewidgets/browser/browserapplication.cpp @@ -245,6 +245,7 @@ void BrowserApplication::loadSettings() defaultSettings->setFontSize(QWebEngineSettings::DefaultFixedFontSize, fixedFont.pointSize()); defaultSettings->setAttribute(QWebEngineSettings::JavascriptEnabled, settings.value(QLatin1String("enableJavascript"), true).toBool()); + defaultSettings->setAttribute(QWebEngineSettings::ScrollAnimatorEnabled, settings.value(QLatin1String("enableScrollAnimator"), true).toBool()); #if defined(QTWEBENGINE_PLUGINS) defaultSettings->setAttribute(QWebEngineSettings::PluginsEnabled, settings.value(QLatin1String("enablePlugins"), true).toBool()); diff --git a/examples/webenginewidgets/browser/settings.cpp b/examples/webenginewidgets/browser/settings.cpp index 49b7709e0000bad796fef8934dfe76bc11f6dad0..d89c49353344a0bfe8745cc442b47fe9e391e9e7 100644 --- a/examples/webenginewidgets/browser/settings.cpp +++ b/examples/webenginewidgets/browser/settings.cpp @@ -87,6 +87,8 @@ void SettingsDialog::loadDefaults() #if defined(QTWEBENGINE_PLUGINS) enablePlugins->setChecked(defaultSettings->testAttribute(QWebEngineSettings::PluginsEnabled)); #endif + + enableScrollAnimator->setChecked(defaultSettings->testAttribute(QWebEngineSettings::ScrollAnimatorEnabled)); } void SettingsDialog::loadFromSettings() @@ -134,6 +136,7 @@ void SettingsDialog::loadFromSettings() enableJavascript->setChecked(settings.value(QLatin1String("enableJavascript"), enableJavascript->isChecked()).toBool()); enablePlugins->setChecked(settings.value(QLatin1String("enablePlugins"), enablePlugins->isChecked()).toBool()); userStyleSheet->setText(settings.value(QLatin1String("userStyleSheet")).toUrl().toString()); + enableScrollAnimator->setChecked(settings.value(QLatin1String("enableScrollAnimator"), enableScrollAnimator->isChecked()).toBool()); settings.endGroup(); #if defined(QWEBENGINEPAGE_SETNETWORKACCESSMANAGER) @@ -218,6 +221,7 @@ void SettingsDialog::saveToSettings() settings.setValue(QLatin1String("standardFont"), standardFont); settings.setValue(QLatin1String("enableJavascript"), enableJavascript->isChecked()); settings.setValue(QLatin1String("enablePlugins"), enablePlugins->isChecked()); + settings.setValue(QLatin1String("enableScrollAnimator"), enableScrollAnimator->isChecked()); QString userStyleSheetString = userStyleSheet->text(); if (QFile::exists(userStyleSheetString)) settings.setValue(QLatin1String("userStyleSheet"), QUrl::fromLocalFile(userStyleSheetString)); diff --git a/examples/webenginewidgets/browser/settings.ui b/examples/webenginewidgets/browser/settings.ui index 3491ce0b0b0f22334bd52c0ca385a6661500b7aa..08374ca7accd2576b37a96d3097d2309b5d988d6 100644 --- a/examples/webenginewidgets/browser/settings.ui +++ b/examples/webenginewidgets/browser/settings.ui @@ -155,7 +155,17 @@ </item> </widget> </item> - <item row="5" column="1" colspan="2" > + <item row="5" column="1" colspan="2"> + <widget class="QCheckBox" name="enableScrollAnimator" > + <property name="text" > + <string>Enable Scroll Animator</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="6" column="1" colspan="2" > <spacer> <property name="orientation" > <enum>Qt::Vertical</enum>