[Qtwebengine] Off-the-record QWebEngineProfiles
Allan Sandfeld Jensen
allan.jensen at qt.io
Wed May 24 17:29:10 CEST 2017
On Wednesday 24 May 2017, Akkana Peck wrote:
> Florian Bruhin writes:
> > Hey Akkana,
> >
> > On Tue, May 23, 2017 at 07:58:45PM -0600, Akkana Peck wrote:
> > > self.page = QWebEnginePage(self.profile)
> >
> > The QWebEnginePage constructor has two overloads:
> > QWebEnginePage(QObject *parent = Q_NULLPTR)
> > QWebEnginePage(QWebEngineProfile *profile, QObject *parent =
> > Q_NULLPTR)
> >
> > Since a QWebEngineProfile is a valid QObject, and you don't pass a
> > second argument, the first one gets selected - i.e. you get the default
> > profile, and your profile as a parent object for the page.
> >
> > If you pass self.webview as a second argument, all works like intended.
>
> Good point! But even if I call
> self.page = QWebEnginePage(None, self.profile)
> self.page.profile().isOffTheRecord() still prints as False.
>
Wrong order, profile is first argument parent is second
--
Allan Sandfeld Jensen
Principal Engineer
The Qt Company GmbH
Rudower Chaussee 13
D-12489 Berlin
allan.jensen at qt.io
+123 45 6789012
http://qt.io
Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin,
Registergericht: Amtsgericht Charlottenburg,
HRB 144331 B
The Future is Written with Qt
www.qtworldsummit.com
More information about the QtWebEngine
mailing list