Hi Soren,

On Thu, Dec 21, 2023 at 12:48:44PM -0700, Soren Stoutner wrote:
> On Thursday, December 21, 2023 3:00:23 AM MST Dmitry Shachnev wrote:
> > Just one particular class (QQuickWebEngineDownloadItem) is private. My guess
> > is that it’s upstream oversight, because upstream documentation even 
> > mentions
> > that one needs to call QWebEngineDownloadRequest::accept() [1], yet calling
> > that method is not possible without including a private header.
> > 
> > [1]: https://doc.qt.io/qt-6/qquickwebengineprofile.html#downloadRequested
> 
> There is both a public and a private version of the header for this class, 
> similar to a lot of classes in Qt WebEngine.
> 
> The public versions of this header are contained in 
> `qquickwebengineprofile.h` 
> and `qwebenginedownloadrequest.h` in the qt6-webengine-dev package.

No, they are both not of _this_ header.

QQuickWebEngineProfile ≠ QQuickWebEngineDownloadRequest
QWebEngineDownloadRequest ≠ QQuickWebEngineDownloadRequest

Maybe my previous emails were not clear enough, let me try again.

Qt has two different interface systems: Qt Widgets and Qt Quick.

Qt Widgets can be used from C++ only. Qt Quick is intended for use from QML,
but sometimes it can be controlled from C++ code, that's why there are C++
classes for it too.

Many Qt modules, including Qt WebEngine, provide classes for both interface
systems.

For example, qt6-webengine source in Debian builds libqt6webenginewidgets6 and
libqt6webenginequick6 binary packages.

Angelfish is written in Qt Quick, unlike many other browsers which are using
Qt Widgets. This is why it needs QQuick* classes, and the widgets classes
can not be a replacement.

> It isn’t clear to me why Qt feels the need to have private headers that 
> mirror 
> their public headers for many of their functions.

This way you can easily change private ABI (e.g. add a new argument) without
breaking the public interface.

See https://wiki.qt.io/D-Pointer for details.

> And there may be some way in which Qt borked their public QML implementation
> of this particular class in  such a way that one really does need to depend
> on the private headers (in  which case, as Dmitry has pointed out, they
> would probably be very willing to fix it if it was reported to them).

Probably. Feel free to create an upstream bug report, based on the analysis
from my previous email.

> But from what I can see by reviewing the code (without taking the time to
> actually build a project and test it out myself) it ought to be possible for
> Angelfish to just switch to using the public headers.

As explained above, no, QQuickWebEngineDownloadRequest does not have a public
header.

--
Dmitry Shachnev

Attachment: signature.asc
Description: PGP signature

Reply via email to