On this page

gridpattern2d QML Value Type

Provides gridpattern2d type matching to QCanvasGridPattern. More...

Import Statement: import QtCanvas2D
Since: Qt 6.12
Status: Technology preview

This type is in technology preview and is subject to change.

Methods

Detailed Description

This value type is provided by the QtCanvas2D import.

See also QCanvasGridPattern.

Method Documentation

color backgroundColor()

Returns the pattern grid background color.

See also setBackgroundColor().

size cellSize()

Returns the size of a single cell in grid pattern.

See also setCellSize().

real feather()

Returns the pattern feather in pixels.

See also setFeather().

color lineColor()

Returns the pattern grid line color.

See also setLineColor().

real lineWidth()

Returns the width of a stroke line in grid pattern.

See also setLineWidth().

real rotation()

Returns the pattern rotation in radians.

See also setRotation().

void setBackgroundColor(color backgroundColor)

Sets the pattern grid background color to backgroundColor. The default value is black.

See also backgroundColor().

void setCellSize(real width, real height)

Sets the size of a single cell in grid pattern to width, height. When width is 0, the horizontal bars are not painted. When height is 0, the vertical bars are not painted. The default value is (10, 10).

See also cellSize().

void setCellSize(size cellSize)

Sets the size of a single cell in grid pattern to cellSize. When width is 0, the horizontal bars are not painted. When height is 0, the vertical bars are not painted. The default value is (10, 10).

This is an overloaded function.

void setFeather(real feather)

Sets the pattern feather to feather in pixels. The default value is 1.0, meaning a single pixel antialiasing.

See also feather().

void setLineColor(color lineColor)

Sets the pattern grid line color to lineColor. The default value is white.

See also lineColor().

void setLineWidth(real width)

Sets the width of a stroke line in grid pattern to width. The default value is 1.0.

See also lineWidth().

void setRotation(real rotation)

Sets the pattern rotation to rotation in radians. Rotation is done around the grid startPosition(). The default value is 0.0, meaning the grid is not rotated.

See also rotation().

void setStartPosition(real x, real y)

Sets the start point of grid pattern to (x, y). Start position means top-left corner of the grid in pattern. Pattern will then be extended to all positions from here. The default value is (0.0, 0.0).

See also startPosition().

void setStartPosition(point start)

Sets the start point of grid pattern to start. Start position means top-left corner of the grid in pattern. Pattern will then be extended to all positions from here. The default value is (0.0, 0.0).

This is an overloaded function.

point startPosition()

Returns the start point of grid pattern.

See also setStartPosition().

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.