Background Grid in Qt QML Applications

C++ QML Qt QtQuick2

Image {
	id: grid

	anchors.fill: parent
	horizontalAlignment: Image.AlignLeft
	verticalAlignment: Image.AlignTop
	fillMode: Image.Tile
	source: "qrc://pix/images/" + gridPattern + ".png"
}
Image {
	id: grid

	anchors.fill: parent
	horizontalAlignment: Image.AlignLeft
	verticalAlignment: Image.AlignTop
	fillMode: Image.Tile
	source: "image://icons/" + gridPattern + "/" + gridColor
}
QQuickImageProvider https://doc.qt.io/qt-5/qquickimageprovider.html
class PixmapBuilder : public QQuickImageProvider
engine.addImageProvider(QLatin1String("icons"), new PixmapBuilder);