[GIS] QGIS 3 how to customize line dash symbology

lineqgis-3Specificationstylesymbology

I want to keep the same line width but specify a much longer dash.

The symbology controls in QGIS 3 have changed significantly from 2.X, so the many answers re: line symbology control for QGIS 2.X are now obsolete.

When I attempt to edit the settings using the button-dropdown to the right of the Stroke style field, I invoke an Expression String Builder that might enable me to customize stroke styles to my heart's delight; but the syntax is not explained.

It looks like it expecting an SQL expression, because it looks like a similar dialog box for managing Attributes. But I cannot find any documentation on how it works. The "Expected Format: string [no|solid|dash|dot|dash dot|dash dot dot]" is cryptic.

Best Answer

Ah! @JGH gave the vital clue. I thought that controlling line-stroke for polylines and the edges of polygons would have the same controls. I am editing symbology for polygon edges. By default on my QGIS 3 install (Linux) no options are presented:

QGIS 3 Symbology Dialog for Polygon Layer

When I open the Symbol Layer Type drop-down field, I can select control of the Outline:

QGIS 3 Symbology Dialog: Symbol Layer Type subfield

And then I have access to the controls which @JGH describes! Yay!

QGIS 3 Symbology Dialog with Line-Stroke control enabled

This may indeed be the same as in QGIS 2.18. I must not have tried to customize the line-stroke of a polygon-edge while using 2.18. While searching this issue, I did not encounter instructions which advised that polygon-edge symbology control is different, and that one must select for Outline:Simple line in order to add controls to the dialog box. I hope this helps others with the keywords I have laid out.

BTW I tried to add this as a comment to @JGH's answer, but [CTRL]+[G] did not add images to a comment; so I created this as an answer to my own question. But @JGH gets credit for the vital hint.

Related Question