Class GridConfig
Build from GridConfig.h
Krita master

The GridConfig class encapsulates a Krita Guides configuration.

Methods

angleAspectLocked()bool angleLeft()float angleLeftActive()bool angleRight()float angleRightActive()bool cellSize()int cellSpacing()int colorMain()QColor colorSubdivision()QColor colorVertical()QColor fromXml(xmlContent: str)bool lineTypeMain()str lineTypeSubdivision()str lineTypeVertical()str offset()QPoint offsetAspectLocked()bool setAngleAspectLocked(angleAspectLocked: bool) setAngleLeft(angleLeft: float) setAngleLeftActive(active: bool) setAngleRight(angleRight: float) setAngleRightActive(active: bool) setCellSize(cellSize: int) setCellSpacing(cellSpacing: int) setColorMain(colorMain: QColor) setColorSubdivision(colorSubdivision: QColor) setColorVertical(colorVertical: QColor) setLineTypeMain(lineType: str) setLineTypeSubdivision(lineType: str) setLineTypeVertical(lineType: str) setOffset(offset: QPoint) setOffsetAspectLocked(offsetAspectLocked: bool) setSnap(snap: bool) setSpacing(spacing: QPoint) setSpacingActiveHorizontal(active: bool) setSpacingActiveVertical(active: bool) setSpacingAspectLocked(spacingAspectLocked: bool) setSubdivision(subdivision: int) setType(gridType: str) setVisible(visible: bool) snap()bool spacing()QPoint spacingActiveHorizontal()bool spacingActiveVertical()bool spacingAspectLocked()bool subdivision()int toXml()str type()str visible()bool

Member documentation

angleAspectLocked()bool
Krita master

Returns status of "Aspect locked" property for angles values (mean, left and right angles values are linked to keep ratio) AngleAspectLocked value is used for grid type "isometric" and "isometric_legacy".

Return

If locked, return True.

angleLeft()float
Krita master

Returns left angle (in degrees) of isometric grid for document. AngleLeft value is used for grid type "isometric".

Return

A positive decimal value, in range [0.00 - 89.00]

angleLeftActive()bool
Krita master

Returns if left angle grid is active. Spacing value is used for grid type "isometric".

Return

a boolean which indicate if left angle grid is active or not

angleRight()float
Krita master

Returns right angle (in degrees) of isometric grid for document. AngleRight value is used for grid type "isometric".

Return

A positive decimal value, in range [0.00 - 89.00]

angleRightActive()bool
Krita master

Returns if right angle grid is active. Spacing value is used for grid type "isometric".

Return

a boolean which indicate if right angle grid is active or not

cellSize()int
Krita master

Returns grid cell border size (in pixels) for document. Cell spacing value is used for grid type "isometric".

Return

A positive integer value, in range [10 - 1000]

cellSpacing()int
Krita master

Returns grid cell spacing (in pixels) for document. Cell spacing value is used for grid type "isometric_legacy".

Return

A positive integer value, minimum value is 10

colorMain()QColor
Krita master

Returns grid main line color

Return

The color for grid main line

colorSubdivision()QColor
Krita master

Returns grid subdivision line color ColorSubdivision value is used for grid type "rectangular".

Return

The color for grid subdivision line

colorVertical()QColor
Krita master

Returns grid vertical line color ColorSubdivision value is used for grid type "isometric".

Return

The color for grid vertical line

fromXml(xmlContent: str)bool
Krita master

Load grid definition from an XML document

Parameters

xmlContent

xml content provided as a string

Return

True if xml content is valid and grid has been loaded, otherwise False

lineTypeMain()str
Krita master

Returns grid main line type

Return

The main line type for grid in current document Can be: - "solid" - "dashed" - "dotted"

Krita master

Returns grid subdivision line type

Return

The subdivision line type for grid in current document Can be: - "solid" - "dashed" - "dotted"

LineTypeSubdivision value is used for grid type "rectangular".

lineTypeVertical()str
Krita master

Returns grid vertical line type

Return

The vertical line type for grid in current document Can be: - "solid" - "dashed" - "dotted" - "none"

LineTypeVertical value is used for grid type "isometric".

offset()QPoint
Krita master

Returns grid offset (in pixels, from origin) for document.

Return

A QPoint that define X and Y offset.

offsetAspectLocked()bool
Krita master

Returns status of "Aspect locked" property for offset values (X and Y values are linked to keep ratio)

Return

If locked, return True.

setAngleAspectLocked(angleAspectLocked: bool)
Krita master

Set status of "Aspect locked" property for angles values (left and right angles values are linked to keep ratio) AngleAspectLocked value is used for grid type "isometric" and "isometric_legacy".

Parameters

angleAspectLocked

Set to True lock aspect.

setAngleLeft(angleLeft: float)
Krita master

Set left angle (in degrees) of isometric grid for document. AngleLeft value is used for grid type "isometric".

Parameters

angleLeft

A positive decimal value, in range [0.00 - 89.00]

setAngleLeftActive(active: bool)
Krita master

Set left angle grid active. Spacing value is used for grid type "isometric".

Parameters

active

True to activate left angle grid, False to deactivate it.

setAngleRight(angleRight: float)
Krita master

Set right angle (in degrees) of isometric grid for document. AngleRight value is used for grid type "isometric".

Parameters

angleRight

A positive decimal value, in range [0.00 - 89.00]

setAngleRightActive(active: bool)
Krita master

Set right angle grid active. Spacing value is used for grid type "isometric".

Parameters

active

True to activate right angle grid, False to deactivate it.

setCellSize(cellSize: int)
Krita master

Set grid cell size (in pixels) for document. Cell spacing value is used for grid type "isometric".

Parameters

cellSize

An integer that define cell border size.

setCellSpacing(cellSpacing: int)
Krita master

Set grid cell spacing for document. Cell spacing value is used for grid type "isometric_legacy".

Parameters

cellSpacing

A integer that define spacing, in range [10 - 1000]

setColorMain(colorMain: QColor)
Krita master

Set grid main line color

Parameters

colorMain(no description provided)
setColorSubdivision(colorSubdivision: QColor)
Krita master

Set grid subdivision line color ColorSubdivision value is used for grid type "rectangular".

Parameters

colorSubdivision(no description provided)
setColorVertical(colorVertical: QColor)
Krita master

Set grid vertical line color ColorSubdivision value is used for grid type "isometric".

Parameters

colorVertical(no description provided)
setLineTypeMain(lineType: str)
Krita master

Set grid main line type

Parameters

lineType

The main line type to apply for grid Can be: - "solid" - "dashed" - "dotted"

setLineTypeSubdivision(lineType: str)
Krita master

Set grid subdivision line type

Parameters

lineType

The subdivision line type to apply for grid Can be: - "solid" - "dashed" - "dotted"

LineTypeSubdivision value is used for grid type "rectangular".

setLineTypeVertical(lineType: str)
Krita master

Set grid vertical line type

Parameters

lineType

The vertical line type to apply for grid Can be: - "solid" - "dashed" - "dotted" - "none"

LineTypeVertical value is used for grid type "isometric".

setOffset(offset: QPoint)
Krita master

Define grid offset (in pixels, from origin) for document.

Parameters

offset

A QPoint that define X and Y offset (X and Y in range [0 - 500])

setOffsetAspectLocked(offsetAspectLocked: bool)
Krita master

Set status of "Aspect locked" property for offset values (X and Y values are linked to keep ratio)

Parameters

offsetAspectLocked

Set to True lock aspect.

setSnap(snap: bool)
Krita master

Activate or deactivate snap to grid for document

Parameters

snap

Set to True to activate snap to grid.

setSpacing(spacing: QPoint)
Krita master

Set grid spacing (in pixels) for document. Spacing value is used for grid type "rectangular".

Parameters

spacing

A QPoint that define X and Y spacing (minimum value for X and Y is 1)

Krita master

Set horizontal grid spacing active. Spacing value is used for grid type "rectangular".

Parameters

active

True to activate horizontal spacing, False to deactivate it.

setSpacingActiveVertical(active: bool)
Krita master

Set vertical grid spacing active. Spacing value is used for grid type "rectangular".

Parameters

active

True to activate vertical spacing, False to deactivate it.

setSpacingAspectLocked(spacingAspectLocked: bool)
Krita master

Set status of "Aspect locked" property for spacing values (X and Y values are linked to keep ratio) SpacingAspectLocked value is used for grid type "rectangular".

Parameters

spacingAspectLocked

Set to True lock aspect.

setSubdivision(subdivision: int)
Krita master

Set number of grid subdivision for document. Subdivision value is used for grid type "rectangular".

Parameters

subdivision

A positive integer value, in range [1 - 10]

setType(gridType: str)
Krita master

Set current grid type applied for document.

Parameters

gridType

The grid type can be: - "rectangular" - "isometric" - "isometric_legacy"

setVisible(visible: bool)
Krita master

Set grid visibility for document.

Parameters

visible(no description provided)
snap()bool
Krita master

Returns snap to grid status for document.

Return

If snap to grid is active on document, return True.

spacing()QPoint
Krita master

Returns grid spacing (in pixels) for document. Spacing value is used for grid type "rectangular".

Return

A QPoint that define X and Y spacing.

Krita master

Returns if horizontal grid spacing is active. Spacing value is used for grid type "rectangular".

Return

a boolean which indicate if horizontal grid is active or not

Krita master

Returns if vertical grid spacing is active. Spacing value is used for grid type "rectangular".

Return

a boolean which indicate if vertical grid is active or not

spacingAspectLocked()bool
Krita master

Returns status of "Aspect locked" property for spacing values (mean, X and Y values are linked to keep ratio) SpacingAspectLocked value is used for grid type "rectangular".

Return

If locked, return True.

subdivision()int
Krita master

Returns number of grid subdivision for document. Subdivision value is used for grid type "rectangular".

Return

A positive integer value, starting from 1

toXml()str
Krita master

Save grid definition as an XML document

Return

A string with xml content

type()str
Krita master

Returns current grid type applied for document.

Return

The grid type can be: - "rectangular" - "isometric" - "isometric_legacy"

visible()bool
Krita master

Returns grid visibility for document.

Return

If grid is visible, return True.