The Scratchpad class A scratchpad is a type of blank canvas area that can be painted on
with the normal painting devices
Methods
Signals
Member documentation
Parameters
view | (no description provided) |
defaultColor | (no description provided) |
parent | (no description provided) |
Return
(no description provided) |
return if scratchpad zoom level is linked with current view zoom level
Return
return True if connection between the zoom of the canvas and scratchpad (so they zoom in sync) is active |
The content of scratchpad can be bigger or smaller than scratchpad dimension. The bounds return the area in which there's some content
Return
scratchpad content bounds as a QRect |
signal is emitted when scratchpad content is changed (stroke or fill)
Take what is on the scratchpad area and grab image
Return
the image data from the scratchpad |
Fill the entire scratchpad with current document projection content
Parameters
fullContent | when True, full document projection is loaded in scratchpad, otherwise only content matching scratchpad viewport is loaded |
Fill the entire scratchpad with current gradient
Parameters
gradientVectorStart | is a QPoint to define origin of gradient Set an empty QPoint() to use default scratchpad top-left |
gradientVectorEnd | is a QPoint to define end of gradient set an empty QPoint() to use default scratchpad bottom-right |
gradientShape | define which gradient to apply, can be: - "linear" - "bilinear" - "radial" - "square" - "conical" - "conicalSymmetric" - "spiral" - "reverseSpiral" - "polygonal" |
gradientRepeat | define how to repeat gradient, can be: - "none" - "alternate" - "forwards" |
reverseGradient | a boolean to define if gradient is reversed or not |
dither | a boolean to define if gradient is dithered or not |
Fill the entire scratchpad with current layer content
Parameters
fullContent | when True, full layer content is loaded in scratchpad, otherwise only content matching scratchpad viewport is loaded |
Fill the entire scratchpad with current pattern
Parameters
transform | is QTransform that let define pattern scale/rotation property |
DEPRECATED -- USE setCanvasZoomLink() instead Makes a connection between the zoom of the canvas and scratchpad area so they zoom in sync
Parameters
value | If True (default) the scratchpad will share the current view zoom level. If False, then use scratchpad scale methods to define current zoom level |
Load image data to the scratchpad
Parameters
image | Image object to load |
pan scratchpad content to top-left position of scratchpad viewport Provided value are absolute
Parameters
x | abscissa position to pan to |
y | ordinate position to pan to |
return current zoom level applied on scratchpad (whatever the zoom source is: view zoom level or set manually)
Return
a float value (1.00 = 100%) |
signal is emitted when scratchpad scale is changed (from zoom canvas or manually)
Parameters
scale | updated scale value (1.00 = 100%) |
reset scale and pan to origin Note: call method is ignored if canvasZoomLink() is True
calculate scale automatically to fit scratchpad content in scratchpad viewport Note: call method is ignored if canvasZoomLink() is True
Makes a connection between the zoom of the canvas and scratchpad area so they zoom in sync
Parameters
value | If True (default) the scratchpad will share the current view zoom level. If False, then use scratchpad scale methods to define current zoom level |
Define default fill color for scratchpad
Parameters
color | (no description provided) |
Manually set what mode scratchpad is in. Ignored if "setModeManually is set to false
Parameters
modeName | Available options are: - "painting" - "panning" - "colorsampling" |
Switches between a GUI controlling the current mode and when mouse clicks control mode
Parameters
value | Set to True allows GUI to control the mode with explicitly setting mode |
allow to manually set scratchpad zoom level Note: call method is ignored if canvasZoomLink() is True,
Parameters
scale | zoom level to apply (1.00 = 100%) |
Return
if scale has been applied return True, otherwise return False |
The viewport indicates which part of scratchpad content is visible. It takes in account the current translation & scale
Example 1: - Scratchpad size: 500x500 - Scratchpad content: 2000x2000 - Scratchpad scale: 1.0 - Scratchpad pan: 0, 0 Returned viewport is a QRect(0, 0, 500, 500) matching content really visible in scratchpad. If scale is 2.00, returned viewport will be QRect(0, 0, 250, 250) If scale is 0.50, returned viewport will be QRect(0, 0, 1000, 1000)
Example 2: - Scratchpad size: 500x500 - Scratchpad content: 2000x2000 - Scratchpad scale: 2.0 - Scratchpad pan: 500, 1500 Returned viewport is a QRect(500, 1500, 250, 250) matching content really visible in scratchpad.
Return
scratchpad viewport bounds as a QRect |
signal is emitted when scratchpad viewport has been modified (pan, zoom)
Parameters
rect | new viewport bounds |