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. Clipping the child element area
Forum Updated to NodeBB v4.3 + New Features

Clipping the child element area

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 315 Views 1 Watching
  • 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.
  • I Offline
    I Offline
    inforathinam
    wrote on last edited by
    #1

    Hi,
    Just want crop the circuar area along with the green rectangle

    I would like to design a wafer.

    d5bd12d9-076d-410d-9411-b5b9d7573692-image.png
    844f0edf-8a21-44e1-9a15-91bd24ee2e02-image.png

    2d187e4c-ff70-44d6-bd4d-bcec2d63f4bc-image.png

    import QtQuick 2.12
    import untitled5 1.0
    
    Rectangle {
        width: 400
        height: 400
        color: "black"
        radius: width / 2
        border.color: "red"
        border.width: 3
        clip: true
        Grid {
            x: 0
            y: 0
            rows: 10
            columns: 10
            spacing: 2
            Repeater {
                model: 100
                Rectangle {
                    width: 40
                    height: 40
                    color: "lightgreen"
                }
            }
        }
    }
    

    Can anyone help me to achieve this?

    Thanks

    JKSHJ 1 Reply Last reply
    0
    • I inforathinam

      Hi,
      Just want crop the circuar area along with the green rectangle

      I would like to design a wafer.

      d5bd12d9-076d-410d-9411-b5b9d7573692-image.png
      844f0edf-8a21-44e1-9a15-91bd24ee2e02-image.png

      2d187e4c-ff70-44d6-bd4d-bcec2d63f4bc-image.png

      import QtQuick 2.12
      import untitled5 1.0
      
      Rectangle {
          width: 400
          height: 400
          color: "black"
          radius: width / 2
          border.color: "red"
          border.width: 3
          clip: true
          Grid {
              x: 0
              y: 0
              rows: 10
              columns: 10
              spacing: 2
              Repeater {
                  model: 100
                  Rectangle {
                      width: 40
                      height: 40
                      color: "lightgreen"
                  }
              }
          }
      }
      

      Can anyone help me to achieve this?

      Thanks

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      @inforathinam said in Clipping the child element area:

      Can anyone help me to achieve this?

      OpacityMask sounds like what you want: https://doc.qt.io/qt-5/qml-qtgraphicaleffects-opacitymask.html

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      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