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

Using anchors.fill for a Canvas item produces a blank scene

    XMLWordPrintable

Details

    • 36c9dd5bc52dd7c2bb38ca3329b5001f26f73f0f

    Description

      If a Canvas item specifies "anchors.fill: parent", it appears to produce a blank scene:

      import QtQuick 2.0
      
      Rectangle {
         width: 300; height: 300
      
         Canvas {
             id: canvas
             //anchors.fill: parent      // produces a blank scene
             width: parent.width; height: parent.height      // ok
      
             onPaint: {
                 var c = canvas.getContext('2d')
                 c.strokeRect(125, 0, 50, 50)
             }
         }
      }
      

      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