Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved How to draw shadow in a rectagle

    General and Desktop
    3
    3
    277
    Loading More Posts
    • 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
      Mr Gisa last edited by

      I was wondering how to draw a shadow in a rectangle like this one (top and bottom only):

      0_1530040896752_9416e3e6-5fb2-4a28-9f9f-7bc8c236b13a-image.png

      0_1530040919455_3b880a5b-0946-45b4-aace-714a4061b9fe-image.png

      Our designer sent this file for me and I have to draw this manually using QRect. The second image describes the position of the shadow.

      D 1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        Hi
        My monitor is old so cant really see the shadow ;)
        But you can make drop shadow effects with
        http://doc.qt.io/qt-5/qgraphicsdropshadoweffect.html#details

        1 Reply Last reply Reply Quote 0
        • D
          Devopia53 @Mr Gisa last edited by

          @Mr-Gisa

          Maybe your designer seems to have used a gradient pattern. like this:

          background-color: qlineargradient(spread:reflect, x1:0, y1:0.574, x2:0, y2:0.306182, stop:0 rgba(0, 0, 155, 255), stop:1 rgba(0, 0, 127, 255));

          1 Reply Last reply Reply Quote 1
          • First post
            Last post