Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qfakexdgportal_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QFAKEXDGPORTAL_P_H
5#define QFAKEXDGPORTAL_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qglobal.h>
19
20QT_BEGIN_NAMESPACE
21
22/*!
23 \internal
24
25 \b{Overview.} This fixture stands in for xdg-desktop-portal so that tests can
26 exercise portal-backed PipeWire code paths without a human present. The real
27 stack looks like:
28
29 \code
30 client (e.g. QPipeWireCaptureHelper)
31 -> D-Bus session bus
32 -> xdg-desktop-portal (interactive consent dialog)
33 -> compositor's PipeWire node
34 \endcode
35
36 QFakeXdgPortalFixture (qfakexdgportalfixture_p.h) replaces the middle two: it
37 starts a private, hardware-free \c pipewire daemon, then re-execs the test
38 binary itself as a helper process on a private D-Bus session bus with no
39 service activation, so the real xdg-desktop-portal can never be reached. That
40 helper process is what this namespace implements. It owns
41 \c org.freedesktop.portal.Desktop and answers portal calls immediately with
42 canned, always-successful responses (FakePortalObject and its per-interface
43 QDBusAbstractAdaptor subclasses in qfakexdgportal.cpp), backed by a
44 QSyntheticPipeWireVideoSource (qsyntheticpipewirevideosource_p.h) that publishes
45 a synthetic, painter-generated frame as if it came from a real screen or
46 camera. A private org.qtproject.qtmultimedia.FakeXdgPortal D-Bus interface lets
47 the fixture drive the helper from the test process (change the published
48 scene, force a specific response code, and so on).
49*/
50namespace QtFakeXdgPortal {
51
52inline constexpr const char *HelperArgument = "--qt-fake-xdg-portal";
53
54int runPortalHelper(int argc, char **argv);
55
56} // namespace QtFakeXdgPortal
57
58QT_END_NAMESPACE
59
60#endif // QFAKEXDGPORTAL_P_H
constexpr const char * HelperArgument
int runPortalHelper(int argc, char **argv)