8 Stylesheets

The appearance of Testmanager layouts can be customised with Qt stylesheets, whose syntax is similar to CSS.

The same widget without and with stylesheet

8.1 Levels

Stylesheets can be defined on three levels:

Level Where Applies to
Global Options → Global stylesheet... All tabs of the layout
Tab Context menu of the canvas All widgets of the tab
Widget Context menu of one or more widgets The selected widgets

More specific stylesheets override general ones.

8.2 Stylesheet editor

Stylesheet editor

The tool bar of the editor helps inserting:

Stylesheet templates
Inserting a color

8.3 Selectors

Widgets are selected by their class name. As the class names of the QtPdWidgets contain the namespace Pd::, which is not valid in stylesheets, the double colon has to be replaced by two dashes:

Pd--Bar {
    background-color: white;
}

Testmanager provides the following special classes:

Class Description
TabPage The canvas of a tab
Legend The legend of a widget

8.4 Resources

Images inserted via the editor are referenced relative to the layout file using the layout: prefix, so the layout directory can be moved as a whole:

QLabel#logo {
    image: url(layout:images/logo.svg);
}
Inserting a resource

8.5 Dynamic properties

Rules can depend on dynamic properties, which can be set from Python scripts (see Python Scripts):

QWidget[negative=true] {
    color: red;
}