![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qfakexdgportalfixture_p.h>
Classes | |
| class | Private |
Public Member Functions | |
| QFakeXdgPortalFixture () | |
| ~QFakeXdgPortalFixture () | |
| q23::expected< void, QString > | start (const SyntheticVideoScene &initialScene) |
| void | stop () |
| bool | isActive () const |
| quint32 | nodeId () const |
| The node id the fake portal reports from Start(). Mostly useful for diagnostics. | |
| q23::expected< void, QString > | setScene (const SyntheticVideoScene &scene) |
| Replaces the content published by the synthetic source. | |
| q23::expected< void, QString > | closeSessions () |
| Revokes the portal session mid-stream, as a compositor would. | |
Static Public Member Functions | |
| static bool | isHelperProcess (int argc, char **argv) |
| True when this process was started as the fake portal helper. | |
| static int | runHelperProcess (int argc, char **argv) |
| static bool | isRequested () |
| Whether the fixture should be used at all. | |
| static bool | prerequisitesAvailable (QString *unavailableReason=nullptr) |
| Whether the external pieces (pipewire, dbus-run-session) are present. | |
| static void | reexecUnderPrivateBusIfRequested (int argc, char **argv) |
| Re-executes the test binary under dbus-run-session when isRequested() and the prerequisites hold, so the whole test runs against a private session bus. | |
| static bool | isRunningOnPrivateBus () |
| True if the current process is already running on the fixture's private bus. | |
Runs an unattended stand-in for xdg-desktop-portal, so that tests can exercise the portal-backed PipeWire code paths end to end without a human approving a consent dialog. Today it implements the ScreenCast interface; the intent is that every portal interface qtmultimedia talks to is faked here.
It brings up, and tears down: \list
org.freedesktop.portal.Desktop on a private D-Bus session bus and publishes a synthetic video source rendering a SyntheticVideoScene. \endlistUsage from a test's main():
The re-exec must happen before QApplication is constructed: QApplication opens the session bus, and QDBusConnection caches it for the lifetime of the process.
Definition at line 64 of file qfakexdgportalfixture_p.h.
| QFakeXdgPortalFixture::QFakeXdgPortalFixture | ( | ) |
Definition at line 167 of file qfakexdgportalfixture.cpp.
| QFakeXdgPortalFixture::~QFakeXdgPortalFixture | ( | ) |
Definition at line 169 of file qfakexdgportalfixture.cpp.
| q23::expected< void, QString > QFakeXdgPortalFixture::closeSessions | ( | ) |
Revokes the portal session mid-stream, as a compositor would.
Definition at line 472 of file qfakexdgportalfixture.cpp.
|
nodiscard |
Definition at line 443 of file qfakexdgportalfixture.cpp.
|
static |
True when this process was started as the fake portal helper.
Definition at line 174 of file qfakexdgportalfixture.cpp.
|
static |
Whether the fixture should be used at all.
Controlled by QT_MULTIMEDIA_TEST_XDG_PORTAL_FIXTURE: "fake" forces it on, "none" forces it off, and the default "auto" enables it on Linux for non-X11 sessions, where the real portal would otherwise block on a consent dialog.
Definition at line 186 of file qfakexdgportalfixture.cpp.
|
static |
True if the current process is already running on the fixture's private bus.
Definition at line 219 of file qfakexdgportalfixture.cpp.
|
nodiscard |
The node id the fake portal reports from Start(). Mostly useful for diagnostics.
Definition at line 448 of file qfakexdgportalfixture.cpp.
Whether the external pieces (pipewire, dbus-run-session) are present.
Definition at line 204 of file qfakexdgportalfixture.cpp.
|
static |
Re-executes the test binary under dbus-run-session when isRequested() and the prerequisites hold, so the whole test runs against a private session bus.
Returns normally when no re-exec is needed or possible.
Definition at line 224 of file qfakexdgportalfixture.cpp.
|
static |
Definition at line 181 of file qfakexdgportalfixture.cpp.
| q23::expected< void, QString > QFakeXdgPortalFixture::setScene | ( | const SyntheticVideoScene & | scene | ) |
Replaces the content published by the synthetic source.
Definition at line 453 of file qfakexdgportalfixture.cpp.
| q23::expected< void, QString > QFakeXdgPortalFixture::start | ( | const SyntheticVideoScene & | initialScene | ) |
Definition at line 357 of file qfakexdgportalfixture.cpp.
| void QFakeXdgPortalFixture::stop | ( | ) |
Definition at line 422 of file qfakexdgportalfixture.cpp.