qt - How to use QtQuick tiled canvas? -


i found document here it's ambiguous understand. can give me example of using tiled canvas?

thanks mitch comment know tiled canvas not work (see here).

the bug still appears in qt 5.4.2 shown example:

import qtquick 2.0  rectangle {     width: 400     height: 400     flickable {         id: flick         anchors.fill: parent         contentwidth: 400         contentheight: 40000     }     canvas {         parent: flick         anchors.fill: parent         contexttype: "2d"         canvassize: qt.size(flick.contentwidth, flick.contentheight)         canvaswindow: qt.rect(flick.contentx, flick.contenty,                               flick.width, flick.height)         tilesize: qt.size(20, 20)         renderstrategy: canvas.cooperative         onpaint: {             (var y = region.y; y < region.y + region.height;                  y += tilesize.height) {                 (var x = region.x; x < region.x + region.width;                      x += tilesize.width) {                     context.fillstyle = "black";                     context.fillrect(x, y, tilesize.width, tilesize.height);                     context.fillstyle = "green";                     context.fillrect(x + 1, y + 1, tilesize.width - 2,                                      tilesize.height - 2);                 }             }         }         oncanvaswindowchanged: requestpaint()     } } 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -