Is the maximum number of rectangles known? If so then the easiest thing would be to precreate them and just show or hide them on demand. If not then you can either create items in C++ using QDeclarativeComponent or pass enough info to QML to create items there using Component and its createObject method.
Bookmarks