Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-21920

If Canvas render target is Canvas.Image, it doesn't render until requestPaint() is called

    XMLWordPrintable

Details

    • 36c9dd5bc52dd7c2bb38ca3329b5001f26f73f0f

    Description

      See following code:

      import QtQuick 2.0
      
      Canvas {
          id: canvas
          width: 300
          height: 300
      
         //renderTarget: Canvas.Image    // if this is set, canvas is blank until we press Return to call requestPaint()
      
         focus: true
         Keys.onReturnPressed: {
             print('repainting...')
             canvas.requestPaint()
         }
      
          onPaint: {
              var c = canvas.getContext('2d')
              c.fillRect(0, 0, 100, 100)
          }
      }
      

      I thought this was related to QTBUG-21590 on Mac but adding an animation to the scene doesn't resolve the issue.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            charles Charles Yin (closed Nokia identity) (Inactive)
            bealam Bea Lam (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes