← All bug reports

FS#1534Headless Styling

Type
Suggestion
Status
Closed
Resolution
Implemented
Category
QCAD (main)
Severity
Low
Priority
Low
Reported version
3.16.4
Operating system
Linux (All / Other)
Reported
2017-01-26 by hungerburg
Closed
2017-01-26 by andrew

Since the launcher batch no longer requests "-style plastique" QT wants to apply the native style of the desktop environment. This fails on a headless system (or where the current user has no graphical shell to connect to) with the message "Gtk-WARNING **: cannot open display: ". Fortunately, QT provides a workaround in addtion to the new "platform=offscreen" flag.

In the tools that set -no-gui, beforehand export these variables into the environment

export QT_STYLE_OVERRIDE=""
export QT_QPA_PLATFORM=offscreen
export DISPLAY=""

PS: QT-offscreen will not find fonts; unfortunately the workaround only allows for a single directory to search them (I need helvetica):

export QT_QPA_FONTDIR="/usr/local/share/fonts/type1"

Maybe that should get reported upstream, so that like LD_LIBRARY_PATH several directories could be specified.

Comments (1)

andrew 2017-01-26

Thanks. I've added this information to the usage info for the various command line tools. The information is also shown if the qcad binary fails to start under Linux (which can be the case on a headless system with GTK as default style).

Note that these settings should in my opinion not be added directly to the command line tool scripts, since that would unnecessarily complicate things for users running the command line tools on systems where X11 is up and running.