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. Large virtual canvas

Large virtual canvas

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 1.0k 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.
  • R Offline
    R Offline
    Roumed
    wrote on last edited by
    #1

    Hello, everybody.

    I try to make a view for a long-time signal. For this task i use two components: Canvas for plot and Flickable for navigation. At this way i create a large virtual canvas, canvas window and tiles with this way:

    @Canvas {
    anchors.fill: parent

    canvasSize: Qt.size(wave.width, height);
    canvasWindow: Qt.rect(flickable.contentX, 0, width, height);
    tileSize: Qt.size(width*2, height)
    
    onPaint: {
        /* painting */
    }
    

    }@

    So, at start on canvas there is correct part of the signal drawn at range from 0 to max(canvasWindow.width, tileSize.width), but if i move outside this range there will be trash from memory. But i expect the continuation of the signal. If i move canvasWindow.x to max(canvasWindow.width, tileSize.width) than all virtual canvas will be looks like trash from memory.

    I'd like just navigate over the signal without redraw. I can't draw all signal at start because of size of the signal: it throws memory overflow error. This solution I found at article "Tiled Canvas":http://qt-project.org/doc/qt-5/qml-qtquick-canvas.html#details from documentation for Canvas.
    What do i do wrong?

    OS: Kubuntu 14.10 and Win7

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Roumed
      wrote on last edited by
      #2

      Solved this problem with requestDraw() at event when canvas window go outside of the drawn tile(s).

      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