Function painter:clip intersects the current clip region with the region described by the current path, that is the region that would be painted by qtpainter.fill. This intersection becomes the new clip region.

The optional boolean optnewpath specifies whether this function resets the current path using painter:newpath(). The default is to leave the current path unchanged. The interior of the current path is determined using the winding rule. See function painter:eoclip for an alternative.

This function cannot enlarge the clipping path. The recommended approach is to call painter:gsave() before reducing the clip region and painter:grestore() to restore the initial clip region.

See also: PostScript operator clip.