Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.7
- import QtQuick.Window 2.0
- import QtGraphicalEffects 1.12
- Item {
- property int size: 48
- property color borderColor: "red"
- property string imageSrc: "qrc:///assets/images/user-standard.png";
- Image {
- id: img
- property bool rounded: true
- property bool adapt: true
- smooth: true
- layer.enabled: rounded
- layer.effect: OpacityMask {
- maskSource: Item {
- width: img.width
- height: img.height
- Rectangle {
- anchors.centerIn: parent
- smooth: true
- width: img.adapt ? img.width : Math.min(img.width, img.height)
- height: img.adapt ? img.height : width
- radius: Math.min(width, height)
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement