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. Visible area of an children Rectangle
Forum Updated to NodeBB v4.3 + New Features

Visible area of an children Rectangle

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 2 Posters 1.6k 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.
  • M Offline
    M Offline
    maxi1994
    wrote on last edited by
    #1

    Hello,

    i trying for hours now ^^ can u help me in my problem ?

    transleted in a simple application:
    @import QtQuick 1.1

    Rectangle {
    width: 360
    height: 360
    id: abc

    Rectangle {
        id: rect_red
        x: 68
        y: 35
        width: 200
        height: 200
        color: "#e21818"
    
        Rectangle {
            id: rect_blue
            x: 158
            y: 166
            width: 89
            height: 67
            color: "#2200ff"
        }
    }
    

    }
    @

    is it posible that only the top left corner of the blue rectangle is shown ? only the part of that Rectangle who is inside of the parent Rectangle ?

    I need it for a dynamic table in a Flickable Object. Cause The Table should be in the middle of an Application. And the Flickable can make every cell accessible.
    layers.sourcerect does not work : cause its unknow (perhapes i need to import something ? )

    I hope u understand all ^^

    thank you for your help :D

    1 Reply Last reply
    0
    • O Offline
      O Offline
      onek24
      wrote on last edited by
      #2

      Hello and welcome to devnet,

      the only thing i could think of is to create a Border of Rectangles around the red rectangle which colors are the background-color and overlay the blue rectangle by using z: 2. --> No overlay over red, but blue is below it.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        maxi1994
        wrote on last edited by
        #3

        hi,
        thank you,
        i also thought about this method .. is there no smarter solution ?
        but if there is nothing else, then it seems i have to do it.

        Thank you

        1 Reply Last reply
        0
        • O Offline
          O Offline
          onek24
          wrote on last edited by
          #4

          Hey,

          unfortunately i don't know of a better method, but i also had no need for that, yet. Maybe someone else can provide you a better method.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            maxi1994
            wrote on last edited by
            #5

            Hi,
            i did like u say it is okey, but i'll be happy for a better solution :D
            Thank you for help :D

            1 Reply Last reply
            0
            • O Offline
              O Offline
              onek24
              wrote on last edited by
              #6

              You're welcome, i'm sure someone else knows a better method. :)

              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