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
QtFakeXdgPortal Namespace Reference

Functions

int runPortalHelper (int argc, char **argv)

Variables

constexpr const char * HelperArgument = "--qt-fake-xdg-portal"

Detailed Description

{Overview.} This fixture stands in for xdg-desktop-portal so that tests can exercise portal-backed PipeWire code paths without a human present. The real stack looks like:

client (e.g. QPipeWireCaptureHelper)
-> D-Bus session bus
-> xdg-desktop-portal (interactive consent dialog)
-> compositor's PipeWire node
#define D(i, j)
static QOpenGLCompositor * compositor

QFakeXdgPortalFixture (qfakexdgportalfixture_p.h) replaces the middle two: it starts a private, hardware-free pipewire daemon, then re-execs the test binary itself as a helper process on a private D-Bus session bus with no service activation, so the real xdg-desktop-portal can never be reached. That helper process is what this namespace implements. It owns org.freedesktop.portal.Desktop and answers portal calls immediately with canned, always-successful responses (FakePortalObject and its per-interface QDBusAbstractAdaptor subclasses in qfakexdgportal.cpp), backed by a QSyntheticPipeWireVideoSource (qsyntheticpipewirevideosource_p.h) that publishes a synthetic, painter-generated frame as if it came from a real screen or camera. A private org.qtproject.qtmultimedia.FakeXdgPortal D-Bus interface lets the fixture drive the helper from the test process (change the published scene, force a specific response code, and so on).

Function Documentation

◆ runPortalHelper()

int QtFakeXdgPortal::runPortalHelper ( int argc,
char ** argv )

Definition at line 487 of file qfakexdgportal.cpp.

Variable Documentation

◆ HelperArgument

const char* QtFakeXdgPortal::HelperArgument = "--qt-fake-xdg-portal"
inlineconstexpr

Definition at line 52 of file qfakexdgportal_p.h.