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. How to load different Path in Shape?

How to load different Path in Shape?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 140 Views
  • 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.
  • K Offline
    K Offline
    Kamichanw
    wrote on last edited by Kamichanw
    #1

    I'm writting a new Rectangle that allows different border.width and radius of each corner. When radius > 0, it should paint an arc, when radius === 0, it shouldn't paint the arc. I've implemented the case with radius > 0, but I don't know how to disable the arc properly. The following code is the code of drawing left bottom corner

    CornerGradient {
        id: leftBottomGradient
        x2: 0
        y2: root.height - (bottomBorder.width + leftBottomRadius)
        x1: leftBorder.width + leftBottomRadius
        y1: root.height
        startColor: bottomBorder.color
        endColor: leftBorder.color
    }
    ShapePath {
        fillGradient: leftBorder.color !== bottomBorder.color ? leftBottomGradient : null
        fillColor: leftBorder.color
        strokeColor: "transparent"
        PathAngleArc {
            centerX: leftBorder.width + leftBottomRadius
            centerY: root.height - (bottomBorder.width + leftBottomRadius)
            startAngle: 90
            sweepAngle: 90
            radiusX: leftBottomRadius
            radiusY: leftBottomRadius
        }
        PathLine {
            x: 0
            y: root.height - (bottomBorder.width + leftBottomRadius)
        }
        PathAngleArc {
            centerX: leftBorder.width + leftBottomRadius
            centerY: root.height - (bottomBorder.width + leftBottomRadius)
            startAngle: 180
            sweepAngle: -90
            radiusX: bottomBorder.width + leftBottomRadius
            radiusY: leftBorder.width + leftBottomRadius
        }
        PathLine {
            x: leftBorder.width + leftBottomRadius
            y: root.height - bottomBorder.width
        }
    }
    
    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