I need to increase the pen width for the below code using Painter/QPen, but nothing that I try works. Can someone please point me in the right direction?
while c_len < MAX_LENGTH:
# Set the pen color for this segment
sat = 200 * (MAX_LENGTH - c_len) / MAX_LENGTH
hue = (color + 130 * (height - y_s) / height) % 360
p.setPen(QPen(QColor_HSV(hue, sat, 255, 20), 2))
You can use the setWidth method of QPen like so:
Just giving the value 2 to the constructor does not work, because there is no matching signature for your arguments.
As an alternative, use arguments that are supported by the signature:
This is preferred, as it avoids a separate function call which is slow in Python.