Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. import QtQuick 2.7
  2. import QtQuick.Window 2.0
  3. import QtGraphicalEffects 1.12
  4.  
  5. Item {
  6. property int size: 48
  7. property color borderColor: "red"
  8. property string imageSrc: "qrc:///assets/images/user-standard.png";
  9.  
  10. Image {
  11. id: img
  12. property bool rounded: true
  13. property bool adapt: true
  14. smooth: true
  15. layer.enabled: rounded
  16. layer.effect: OpacityMask {
  17. maskSource: Item {
  18. width: img.width
  19. height: img.height
  20. Rectangle {
  21. anchors.centerIn: parent
  22. smooth: true
  23. width: img.adapt ? img.width : Math.min(img.width, img.height)
  24. height: img.adapt ? img.height : width
  25. radius: Math.min(width, height)
  26. }
  27. }
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement