aboutsummaryrefslogtreecommitdiff
path: root/src/webengine
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-12-23 02:04:26 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2017-12-23 02:04:26 +0100
commite4c0b4832b715f3c312ef15716c31a9879930553 (patch)
tree5b54a79068f53ea3cd2f6c0ab17206c70911ba50 /src/webengine
parentSingle instance check works again (diff)
downloadsmolbote-e4c0b4832b715f3c312ef15716c31a9879930553.tar.xz
smolbote can now compile on Qt 5.7.1
Diffstat (limited to 'src/webengine')
-rw-r--r--src/webengine/webengineprofile.cpp6
-rw-r--r--src/webengine/webview.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/webengine/webengineprofile.cpp b/src/webengine/webengineprofile.cpp
index ff92803..cee23da 100644
--- a/src/webengine/webengineprofile.cpp
+++ b/src/webengine/webengineprofile.cpp
@@ -92,9 +92,11 @@ WebEngineProfile::WebEngineProfile(const QString &name, const QString &path, QOb
settings()->setAttribute(QWebEngineSettings::Accelerated2dCanvasEnabled, config.value("accelerated2dCanvasEnabled", true).toBool());
settings()->setAttribute(QWebEngineSettings::AutoLoadIconsForPage, config.value("autoLoadIconsForPage", true).toBool());
settings()->setAttribute(QWebEngineSettings::TouchIconsEnabled, config.value("touchIconsEnabled", false).toBool());
+#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, config.value("focusOnNavigationEnabled", true).toBool());
settings()->setAttribute(QWebEngineSettings::PrintElementBackgrounds, config.value("printElementBackgrounds", true).toBool());
settings()->setAttribute(QWebEngineSettings::AllowRunningInsecureContent, config.value("allowRunningInsecureContent", false).toBool());
+#endif
config.endGroup(); // attributes
@@ -185,17 +187,13 @@ void WebEngineProfile::saveProfile()
config.setValue("hyperlinkAuditingEnabled", s->testAttribute(QWebEngineSettings::HyperlinkAuditingEnabled));
config.setValue("scrollAnimatorEnabled", s->testAttribute(QWebEngineSettings::ScrollAnimatorEnabled));
config.setValue("errorPageEnabled", s->testAttribute(QWebEngineSettings::ErrorPageEnabled));
-#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
config.setValue("pluginsEnabled", s->testAttribute(QWebEngineSettings::PluginsEnabled));
config.setValue("fullscreenSupportEnabled", s->testAttribute(QWebEngineSettings::FullScreenSupportEnabled));
-#endif
-#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
config.setValue("screenCaptureEnabled", s->testAttribute(QWebEngineSettings::ScreenCaptureEnabled));
config.setValue("webglEnabled", s->testAttribute(QWebEngineSettings::WebGLEnabled));
config.setValue("accelerated2dCanvasEnabled", s->testAttribute(QWebEngineSettings::Accelerated2dCanvasEnabled));
config.setValue("autoLoadIconsForPage", s->testAttribute(QWebEngineSettings::AutoLoadIconsForPage));
config.setValue("touchIconsEnabled", s->testAttribute(QWebEngineSettings::TouchIconsEnabled));
-#endif
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
config.setValue("focusOnNavigationEnabled", s->testAttribute(QWebEngineSettings::FocusOnNavigationEnabled));
config.setValue("printElementBackgrounds", s->testAttribute(QWebEngineSettings::PrintElementBackgrounds));
diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp
index 55efad7..a4bff5e 100644
--- a/src/webengine/webview.cpp
+++ b/src/webengine/webview.cpp
@@ -96,6 +96,7 @@ WebView::WebView(MainWindow *parentMainWindow, QWidget *parent) :
this->triggerPageAction(QWebEnginePage::SavePage);
});
+#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
QAction *printAction = m_pageMenu->addAction(tr("Print page"));
connect(printAction, &QAction::triggered, [this]() {
QPrinter *printer = new QPrinter(QPrinterInfo::defaultPrinter());
@@ -108,6 +109,7 @@ WebView::WebView(MainWindow *parentMainWindow, QWidget *parent) :
}
delete dlg;
});
+#endif
QAction *printPdfAction = m_pageMenu->addAction(tr("Print to PDF"));
connect(printPdfAction, &QAction::triggered, [this]() {