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. DropShadow over entire Rectangle
Forum Updated to NodeBB v4.3 + New Features

DropShadow over entire Rectangle

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 560 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.
  • freddy311082F Offline
    freddy311082F Offline
    freddy311082
    wrote on last edited by p3c0
    #1

    Hi guys... i have a piece of code like that:

    Rectangle {
            id: root
            width: Screen.width
            height: patientName.height + 20 + rectangle2.height + 132 + gridView1.height + 20
            color: "#00000000"
    
            Rectangle{
                id: background
                anchors.topMargin: 50
                anchors.centerIn: parent
                radius: 15
                width: parent.width *2/3
                height: root.height - 10
                color: "#ffdbeef5"
            }
    
            DropShadow {
                   anchors.fill: background
                   horizontalOffset: -3
                   verticalOffset: -3
                   radius: 3
                   samples: radius * 2
                   color: "#80000000"
                   source: background
                   fast: true
               }
    
        }
    

    my problem is that i need a show over the entire border of rectangle and I had test with every variant of combinations of the offset values, but I only get shadow in some part of the recatangle...

    how can I do that ??

    regards

    1 Reply Last reply
    0
    • L Offline
      L Offline
      literA2
      wrote on last edited by literA2
      #2

      Use RectangularGlow instead of Dropshadow and place it on top of your Rectangle.

      Rectangle {
          id: root
          width: Screen.width
          height: patientName.height + 20 + rectangle2.height + 132 + gridView1.height + 20
          color: "#00000000"
      
          RectangularGlow {
            anchors.fill: background
            glowRadius: 1
            spread: 0
            cornerRadius: 10
            color: "#80000000"
         }
      
          Rectangle{
              id: background
              anchors.topMargin: 50
              anchors.centerIn: parent
              radius: 15
              width: parent.width *2/3
              height: root.height - 10
              color: "#ffdbeef5"
          }
      }
      
      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