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

PathSvg draws solid line instead of dashed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • dev
    • Quick: Shapes
    • None

    Description

      import QtQuick
      import QtQuick.Shapes
      
      Window {
          id: root
          width: 400
          height: 400
          visible: true
      
          Rectangle {
              id: rect1
              width: 60
              height: 40
      
              Canvas {
                  anchors.fill: parent
      
                  onPaint: {
                      let context = getContext("2d")
                      context.strokeStyle = Qt.rgba(0, 0, 0, 1)
                      context.setLineDash([1, 1])
                      context.beginPath()
                      context.rect(0.5, 0.5, width - 1, height - 1)
                      context.stroke()
                  }
              }
          }
      
          Rectangle {
              id: rect2
              x: 100
              width: 60
              height: 40
      
              Shape {
                  ShapePath {
                      id: shapePath
                      strokeColor: "#000000"
                      strokeStyle: ShapePath.DashLine
                      dashPattern: [1, 1]
                      fillColor: "transparent"
      
                      PathSvg {
                          path: `m 0.5,0.5 h ${rect2.width - 1} v ${rect2.height - 1} h ${-(rect2.width - 1)} v ${-(rect2.height - 1)}`
                      }
                  }
              }
          }
      }
      

      Attachments

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

        Activity

          People

            lagocs Laszlo Agocs
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes