Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. In qml, canvas width can not be longer than 8520, why?
Forum Updated to NodeBB v4.3 + New Features

In qml, canvas width can not be longer than 8520, why?

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mileszhang
    wrote on last edited by
    #1

    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();
        }
    }
    

    }@

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mileszhang
      wrote on last edited by
      #2

      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"
      } @

      1 Reply Last reply
      0
      • jeremy_kJ Offline
        jeremy_kJ Offline
        jeremy_k
        wrote on last edited by
        #3

        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?

        Asking a question about code? http://eel.is/iso-c++/testcase/

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mileszhang
          wrote on last edited by
          #4

          [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.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved