Created
January 30, 2020 17:04
-
-
Save HamedMasafi/fd79b6a3dbdcc57b9358fe2c58e34af0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.14 | |
import QtQuick.Window 2.14 | |
import QtQuick.Shapes 1.12 | |
import QtQuick.Controls 2.12 | |
Window { | |
visible: true | |
width: 640 | |
height: 480 | |
title: qsTr("Hello World") | |
property int radius: slider.value | |
Slider { | |
id: slider | |
value: 50 | |
from: 0 | |
to: 150 | |
} | |
Rectangle { | |
color: 'yellow' | |
anchors.centerIn: parent | |
height: 180 | |
width: 320 | |
} | |
Shape { | |
id: shape | |
anchors.centerIn: parent | |
height: 180 | |
width: 320 | |
ShapePath { | |
strokeColor: 'red' | |
strokeWidth: 2 | |
fillColor: 'transparent' | |
strokeStyle: ShapePath.DashLine | |
dashPattern: [4, 8] | |
startX: radius | |
startY: 0 | |
PathLine { | |
x: shape.width - radius | |
y: 0 | |
} | |
PathCubic { | |
control1X: shape.width | |
control2X: shape.width | |
control1Y: 0 | |
control2Y: 0 | |
x: shape.width | |
y: radius | |
} | |
PathLine { | |
x: shape.width | |
y: shape.height - radius | |
} | |
PathCubic { | |
control1X: shape.width | |
control2X: shape.width | |
control1Y: shape.height | |
control2Y: shape.height | |
x: shape.width - radius | |
y: shape.height | |
} | |
PathLine { | |
x: radius | |
y: shape.height | |
} | |
PathCubic { | |
control1X: 0 | |
control2X: 0 | |
control1Y: shape.height | |
control2Y: shape.height | |
x: 0 | |
y: shape.height - radius | |
} | |
PathLine { | |
x: 0 | |
y: radius | |
} | |
PathCubic { | |
control1X: 0 | |
control2X: 0 | |
control1Y: 0 | |
control2Y: 0 | |
x: radius | |
y: 0 | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment