Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to draw shadow in a rectagle
Forum Updated to NodeBB v4.3 + New Features

How to draw shadow in a rectagle

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 545 Views 2 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
    Mr Gisa
    wrote on last edited by
    #1

    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
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0
      • M Mr Gisa

        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 Offline
        D Offline
        Devopia53
        wrote on last edited by
        #3

        @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
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved