Results 1 to 6 of 6

Thread: Create shadow view surrounding the shape.

  1. #1
    Join Date
    May 2011
    Posts
    120
    Thanks
    9
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Create shadow view surrounding the shape.

    Hi
    I create a shape through paint , now the problem is that i have to give shadow view arround this shape , how should do this.
    I read that by using the class QGraphicsEffect i can create shadow view but how to do i am not understanding.
    Give me some code example or anything else related to this.

    Waiting for your quick reply.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Create shadow view surrounding the shape.

    Is the drop shadow supposed to be for QGraphicsItem s in a scene, or do you mean for widgets on top a top level windows, or for top level windows?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    May 2011
    Posts
    120
    Thanks
    9
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Create shadow view surrounding the shape.

    i have to create 3d view around the shape drawn by paint , yes mean to drop shadow but this is not which i want.
    Suggest me how to do this. I have six hexagon shape combined to each other , arround them i have to create the 3d view,

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Create shadow view surrounding the shape.

    You didn't answer my question.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    May 2011
    Posts
    120
    Thanks
    9
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Create shadow view surrounding the shape.

    I mean for the widget on window

    i create shape on frame and that frame i apply on the window.

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Create shadow view surrounding the shape.

    In that case QGraphicsEffect will not help you, since its only to be used on QGraphicsItem s, which live in a scene.
    As long as you want to have the effect only for child widgets of a parent widget/window in your application, you could implement a custom widget which will "wrap" each widget you want to have the shadow effect for, and use semi transparent gradient or semi transparent image background on the wrapper widget to create the shadow.

    Creating the shadow for top level windows, is a much more complected issue as you application has no information of anything out side it self.
    In modern window managers, you can have the effect for all top level windows which is done by the window manager, not just for your application. in which case there is nothing you should do as a developer, but that is a different issue.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 5
    Last Post: 3rd April 2010, 04:07
  2. Create gradient and shadow on text?
    By Kevin Hoang in forum Qt Programming
    Replies: 1
    Last Post: 21st March 2010, 08:41
  3. About QTreeView's shadow.
    By yangyunzhao in forum Qt Programming
    Replies: 3
    Last Post: 19th August 2009, 08:52
  4. A Shadow of my groupBox
    By baray98 in forum Qt Programming
    Replies: 1
    Last Post: 28th June 2008, 21:41
  5. Example HowTo create custom view
    By dexjam in forum Newbie
    Replies: 6
    Last Post: 12th July 2006, 11:06

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.