run_desktop.h Header

Apps › Desktop

#include <run_desktop.h>

Types

struct DesktopAppConfig Settings that a desktop app passes to run_desktop() to start up.

Functions

int run_desktop(int argc, char ** argv, const DesktopAppConfig & config)

Function Documentation

int run_desktop(int argc, char ** argv, const DesktopAppConfig & config)

Runs a desktop app with the given settings, and returns its exit code once the app quits.

Starts Qt, loads the styles and themes, calls the config's build, and opens the app's window. The window has no OS frame, so the app's UI provides its own title bar and window buttons. It opens at 1000 × 700 px, and the user can shrink it down to 360 × 240 px (or to the launch size, when the variables below set a smaller one). Returns 1 without opening a window when no theme loads (see frameworkAssetDir).

Environment variables

These variables change a single run, mostly for testing without a screen:

Variable Effect
VORTEX_THEME Theme ID to use, without saving it
VORTEX_WIDTH, VORTEX_HEIGHT Window size at launch (px)
VORTEX_SHOT Path for a screenshot of the window
VORTEX_SHOT2 Path for a second screenshot, after the VORTEX_CLICK steps
VORTEX_CLICK Comma-separated steps, "Toggle" by default
VORTEX_SHOT_DELAY Wait before the first screenshot (ms), 200 by default
VORTEX_CLICK_DELAY Wait between steps (ms), 1 by default
VORTEX_SHOT2_DELAY Wait before the second screenshot (ms), 100 by default
QT_AUDIO_BACKEND Qt's audio backend, "pulseaudio" by default in Linux builds with video

If VORTEX_THEME is set, it becomes the active theme and the user's theme is ignored. If neither are set, the default theme (Dark) is used.

The app quits after its last screenshot.

Each VORTEX_CLICK step clicks a widget found by its object name, or types into its text field when the step has an =. A step whose widget isn't found is skipped:

Save Button                // Clicks the widget named "Save Button"
Create Node Drawer/Header  // Clicks "Header" inside "Create Node Drawer"
post-*                     // Clicks the first widget whose name starts with "post-"
Host=example.com           // Replaces the text in "Host" with "example.com"

With VORTEX_SHOT2, any other open window, like a dialog, is saved beside the second screenshot with .win0.png, .win1.png, and so on in place of its extension.

  • argc and argv are main()'s arguments, which Qt reads.
› Documentation
Appearance
Theme
—