Uploaded image for project: 'Qt for MCUs'
  1. Qt for MCUs
  2. QTMCU-151

Code snippet for PathCubic doesn't work as is.

    XMLWordPrintable

Details

    • All

    Description

      doc link : https://doc.qt.io/QtForMCUs-2.4/qml-qtquick-pathcubic.html

      In this page, there's a code snippet:

      Path {
          startX: 20; startY: 0
          PathCubic {
              x: 180; y: 0
              control1X: -10; control1Y: 90
              control2X: 210; control2Y: 90
          }
      } 

      Which is claimed to output this result:

      However, since the snippet is using "Path," which is invisible, when copied and run on Qt Creator, it doesn't dwaw anything in the window.

       

      The code snippet should be replaced with this one, which a note saying that the user should link Qul::Shapes to the project to import QtQuick.Shapes.

      import QtQuick 2.0
      import QtQuick.Shapes
      Rectangle {
          width: 300
          height: 300
          Shape {
              ShapePath {
                  strokeColor: "black"
                  startX: 20; startY: 0
                  PathCubic {
                      x: 180; y: 0
                      control1X: -10; control1Y: 90
                      control2X: 210; control2Y: 90
                  }
              }
          }
      } 

      The code above shows this result:

       

      Attachments

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

        Activity

          People

            estorman Esa Törmänen
            mikio_hirai Mikio Hirai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes