[PyQt] How to get box shadows in qlabels?

Souvik Dutta souvik.viksou at outlook.com
Wed Mar 11 00:47:45 GMT 2020


Thank you that was the answer we want. Thank you.

On Wed, 11 Mar, 2020, 6:03 am Maurizio Berti, <maurizio.berti at gmail.com>
wrote:

> Stylesheet features on Qt are limited, as it only supports a subset of CSS
> properties (not unlike the subset of HTML for rich text); as you have
> already found out, there's no box-shadow property. They are useful for
> specific design purposes, can be very useful for small and easy
> modifications to the widget appearance (and some other things, since they
> support qproperties), and can be used to do fancy tricks without manual
> painting and/or QStyle overrides, but be careful: some widgets (usually
> composite widgets, like spinboxes, combo, sliders) require to be fully
> implemented in the stylesheet, otherwise they won't work.
>
> That said, I became curious about the neumorphism topic, and I decided to
> give it a try, mostly because I never created a full QGraphicsEffect on my
> own.
>
> I published the answer on StackOverflow, since I believe it could be
> useful to others too.
>
>
> https://stackoverflow.com/questions/60626717/can-i-apply-a-neumorphism-effect-to-a-qwidget
>
> You can see the result in the attached image, while the full description
> on how it was implemented is on the link.
>
> Cheers,
> Maurizio
>
> Il giorno lun 9 mar 2020 alle ore 03:35 Souvik Dutta <
> souvik.viksou at outlook.com> ha scritto:
>
>> I am trying to get some neumorphism effect in qlabel. I want two box
>> shadows for this. Both of them will be in opposite direction, one will be
>> white and another will be black. How can I do this, I mean is there an
>> inbuilt function. I tried adding box-shadows, box-shadow and boxshadow in
>> the style sheet but everytime it says no property called boxshadow.
>> _______________________________________________
>> PyQt mailing list    PyQt at riverbankcomputing.com
>> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
>>
>
>
> --
> È difficile avere una convinzione precisa quando si parla delle ragioni
> del cuore. - "Sostiene Pereira", Antonio Tabucchi
> http://www.jidesk.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20200311/17fcd8fb/attachment.htm>


More information about the PyQt mailing list