In qml, canvas width can not be longer than 8520, why?
-
hi,
I recently develop on QT 5.1,and I have found in my personal computer (cpu : i7), canvas width can not be longer than 8520 in my qml file. why?
can any one tell me?
I need such length of longer than 8520 for my development.
how I fix it?
thx.the following is the source code for debug.
@Rectangle{
width: 800; height: 480
color:"transparent"Canvas{ id:canvas width:8520 height:480; onPaint: { var ctx = canvas.getContext("2d");//Context2D ctx.globalCompositeOperation = "source-over"; ctx.clearRect(0,0,width,height);//Clears all pixels on the canvas in the given rectangle to transparent black. ctx.lineWidth = 1; ctx.save(); ctx.fillStyle = ctx.createPattern("#6699CC",Qt.SolidPattern); ctx.beginPath(); ctx.rect(0,0,canvas.width,canvas.height); ctx.closePath(); ctx.fill(); ctx.restore(); } }
}@
-
besides,I find Rectangle maximum width is not longer than 8520.
how is that limits determined? Is there something to do with platform frame buffer of display?
for example: it will be failed!@Rectangle{
width: 8520; height: 480
//color:"transparent"
color:"#6699CC"
} @ -
Based on the documentation for Canvas, I suspect you want to set canvasSize and canvasWindow, unless the display being targeted really is greater than 8520 pixels wide.
For me with Qt 5.3.0 and XCB, a canvas with width or height greater than 8192 fails to render. I'm not sure where the limitation comes from, but the fact that it occurs above 8k seems noncoincidental. Does a width of 8519 work for you?
-
[quote author="jeremy_k" date="1401233474"]Based on the documentation for Canvas, I suspect you want to set canvasSize and canvasWindow, unless the display being targeted really is greater than 8520 pixels wide.
For me with Qt 5.3.0 and XCB, a canvas with width or height greater than 8192 fails to render. I'm not sure where the limitation comes from, but the fact that it occurs above 8k seems noncoincidental. Does a width of 8519 work for you?[/quote]
hi,
thanks for your tips.
I do not test such width 8519.
but I guess the limitation is something to do with hardware platform, may be about the graphics chip.
I port my qml code to arm platform(TI am335x, contex-A8).sadly,beyond my mind, the width can not more than 2400.