summaryrefslogtreecommitdiffstats
path: root/examples/webenginewidgets/browser/browsermainwindow.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-08-18 18:19:48 +0200
committerAllan Sandfeld Jensen <allan.jensen@digia.com>2014-08-19 10:16:04 +0200
commitafd4c43bcef467da03d89d5468742a1dcbfa04fa (patch)
tree40e76f4472d79c2365f63c8af66f164e2bafbbb1 /examples/webenginewidgets/browser/browsermainwindow.cpp
parent89c41f52f6d90d9cad2b054908ef51238c6612a9 (diff)
Re-enable some qwebenginesetting features in browser example
We now have the QWebEngineSettings class and can re-enable the features that were previously disabled in the browser that depended on it. Change-Id: I525dd1a4b5c380ad4c6060f276440e069f633897 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'examples/webenginewidgets/browser/browsermainwindow.cpp')
-rw-r--r--examples/webenginewidgets/browser/browsermainwindow.cpp20
1 files changed, 3 insertions, 17 deletions
diff --git a/examples/webenginewidgets/browser/browsermainwindow.cpp b/examples/webenginewidgets/browser/browsermainwindow.cpp
index da026edf7..85b16580f 100644
--- a/examples/webenginewidgets/browser/browsermainwindow.cpp
+++ b/examples/webenginewidgets/browser/browsermainwindow.cpp
@@ -68,6 +68,7 @@
#include <QtWidgets/QInputDialog>
#include <QWebEngineHistory>
+#include <QWebEngineSettings>
#include <QtCore/QDebug>
@@ -295,7 +296,7 @@ void BrowserMainWindow::setupMenu()
fileMenu->addAction(tr("&Print..."), this, SLOT(slotFilePrint()), QKeySequence::Print);
fileMenu->addSeparator();
#endif
-#if defined(QWEBENGINESETTINGS)
+#if defined(QTWEBENGINE_PRIVATEBROWSING)
QAction *action = fileMenu->addAction(tr("Private &Browsing..."), this, SLOT(slotPrivateBrowsing()));
action->setCheckable(true);
fileMenu->addSeparator();
@@ -380,12 +381,6 @@ void BrowserMainWindow::setupMenu()
viewMenu->addAction(tr("Zoom &In"), this, SLOT(slotViewZoomIn()), QKeySequence(Qt::CTRL | Qt::Key_Plus));
viewMenu->addAction(tr("Zoom &Out"), this, SLOT(slotViewZoomOut()), QKeySequence(Qt::CTRL | Qt::Key_Minus));
viewMenu->addAction(tr("Reset &Zoom"), this, SLOT(slotViewResetZoom()), QKeySequence(Qt::CTRL | Qt::Key_0));
-#if defined(QWEBENGINESETTINGS)
- QAction *zoomTextOnlyAction = viewMenu->addAction(tr("Zoom &Text Only"));
- connect(zoomTextOnlyAction, SIGNAL(toggled(bool)), this, SLOT(slotViewZoomTextOnly(bool)));
- zoomTextOnlyAction->setCheckable(true);
- zoomTextOnlyAction->setChecked(false);
-#endif
viewMenu->addSeparator();
viewMenu->addAction(tr("Page S&ource"), this, SLOT(slotViewPageSource()), tr("Ctrl+Alt+U"));
@@ -701,7 +696,7 @@ void BrowserMainWindow::printRequested(QWebEngineFrame *frame)
void BrowserMainWindow::slotPrivateBrowsing()
{
-#if defined(QWEBENGINESETTINGS)
+#if defined(QTWEBENGINE_PRIVATEBROWSING)
QWebEngineSettings *settings = QWebEngineSettings::globalSettings();
bool pb = settings->testAttribute(QWebEngineSettings::PrivateBrowsingEnabled);
if (!pb) {
@@ -800,15 +795,6 @@ void BrowserMainWindow::slotViewResetZoom()
currentTab()->setZoomFactor(1.0);
}
-void BrowserMainWindow::slotViewZoomTextOnly(bool enable)
-{
-#if defined(QWEBENGINESETTINGS)
- if (!currentTab())
- return;
- currentTab()->page()->settings()->setAttribute(QWebEngineSettings::ZoomTextOnly, enable);
-#endif
-}
-
void BrowserMainWindow::slotViewFullScreen(bool makeFullScreen)
{
if (makeFullScreen) {