Results 1 to 2 of 2

Thread: how to set opacity to a shadow for a widget

  1. #1
    Join Date
    Jul 2012
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default how to set opacity to a shadow for a widget

    Hello,
    i have a QPushButton . To enable shadow for this, i have done the following:

    QGraphicsDropShadowEffect* effect = new QGraphicsDropShadowEffect();

    button->setGraphicsEffect(effect);

    Here 'button' is my custom control derived from QPushButton.

    It works.

    Now I also need to add opacity to the shadow part only.

    How to achieve this?

    Any help would be useful.

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to set opacity to a shadow for a widget

    Did you try to use fourth parameter of QColor (it's alpha)?
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. The following user says thank you to spirit for this useful post:

    ginu (3rd August 2012)

Similar Threads

  1. Text drop-shadow using CSS (text-shadow)
    By xtal256 in forum Qt Programming
    Replies: 2
    Last Post: 13th July 2018, 10:08
  2. Layered Opacity
    By JeffC in forum Newbie
    Replies: 0
    Last Post: 9th June 2010, 15:42
  3. Replies: 2
    Last Post: 11th November 2009, 08:03
  4. Plasmoid opacity
    By AcerExtensa in forum KDE Forum
    Replies: 3
    Last Post: 25th July 2009, 14:22
  5. Opacity in Linux OS
    By shyam prasad in forum Qt Programming
    Replies: 2
    Last Post: 22nd May 2007, 05:59

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.