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 setup a rectangle like this
Forum Updated to NodeBB v4.3 + New Features

How to setup a rectangle like this

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 2 Posters 445 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.
  • Y Offline
    Y Offline
    yegender
    wrote on last edited by
    #1

    Screenshot_20221114_194650.png

    Here the inner black color is canceled out colored of the white rectangle. In short terms: I just want to have a rectangle with a specific region of it should be transparent

    1 Reply Last reply
    0
    • JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by
      #2

      Is it easier to create a rectangle for the specific region with the same color as the background color? It does not need to be transparent. It is like a fake one.

      Y 1 Reply Last reply
      0
      • JoeCFDJ JoeCFD

        Is it easier to create a rectangle for the specific region with the same color as the background color? It does not need to be transparent. It is like a fake one.

        Y Offline
        Y Offline
        yegender
        wrote on last edited by
        #3

        @JoeCFD But background is going to be a picture instead of black color

        JoeCFDJ 1 Reply Last reply
        0
        • Y yegender

          @JoeCFD But background is going to be a picture instead of black color

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by JoeCFD
          #4

          @yegender I see. you create a rectangle and add a border(4 sides can be set differently) to it. Then make it transparent. If you need the blue border as well, create two rectangles and do the same thing. Make one is smaller than the other one.

          1 Reply Last reply
          0
          • Y Offline
            Y Offline
            yegender
            wrote on last edited by yegender
            #5

            Thanks for this I got it how to do it :)

            This is for those who came this post for similar solution:

            Rectangle{
                                color:"transparent"
                                border.color:"#88000000"
                                border.width: 5
                                x:200
                                y:200
                                width:640
                                height:480
                                radius:5
                                Rectangle{
                                    x:parent.border.width
                                    width:parent.width-10
                                    y:parent.border.width
                                    height:30
                                    color:"#88000000"
                                }
                            }
            

            And it's output:
            b9af4054-a924-4e9f-82c6-e6d8e1153ad4-image.png

            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