diff options
author | Kirill Burtsev <kirill.burtsev@qt.io> | 2019-04-10 18:27:31 +0200 |
---|---|---|
committer | Kirill Burtsev <kirill.burtsev@qt.io> | 2019-04-23 14:09:11 +0000 |
commit | 5f81848067f2142b7c78d6ca758c9efc5c1ab1d8 (patch) | |
tree | 7f03ce8097c3b5fcf175b8c4e4df7a5b60ae4f46 /examples/webenginewidgets/simplebrowser/doc | |
parent | c6fb532d81f405b2456c382aa0b29eef8866f993 (diff) |
Simple browser example: create off-the-record profile in a lazy manner
Do not create multiple profiles immediately on start. Allows to start
and run browser with default profile with 'single-process' flag.
Change-Id: Idea7da8167152f718a3c2d4086ad4216d8e1b722
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Diffstat (limited to 'examples/webenginewidgets/simplebrowser/doc')
-rw-r--r-- | examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc index b5ad13626..251ca5ad8 100644 --- a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc +++ b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc @@ -270,7 +270,7 @@ Implementing private browsing is quite easy using \QWE. All one has to do is to create a new \l{QWebEngineProfile} and use it in the \l{QWebEnginePage} instead of the default profile. In the example this new - profile is created and owned by the \c Browser object: + profile is owned by the \c Browser object: \quotefromfile webenginewidgets/simplebrowser/browser.h \skipto /^class Browser$/ @@ -285,15 +285,24 @@ \printline m_otrProfile \printline /^\};$/ - The default constructor for \l{QWebEngineProfile} already puts it in - \e{off-the-record} mode. All that is left to do is to pass the appropriate - profile down to the appropriate \l QWebEnginePage objects. The \c Browser - object will hand to each new \c BrowserWindow either the global default - profile (see \l{QWebEngineProfile::defaultProfile}) or its own - off-the-record profile: + Required profile for \e{private browsing} is created together with its + first window. The default constructor for \l{QWebEngineProfile} already + puts it in \e{off-the-record} mode. \quotefromfile webenginewidgets/simplebrowser/browser.cpp + \skipto Browser::createWindow + \printuntil m_otrProfile.reset + \dots + + All that is left to do is to pass the appropriate profile down to the + appropriate \l QWebEnginePage objects. The \c Browser object will hand to + each new \c BrowserWindow either the global default profile + (see \l{QWebEngineProfile::defaultProfile}) or one shared + \e{off-the-record} profile instance: + + \dots + \skipto m_otrProfile.get \printuntil mainWindow = new BrowserWindow \skipto return mainWindow \printuntil /^\}/ |