[Qt-interest] make QScrollArea transparent

wim.delvaux at adaptiveplanet.com wim.delvaux at adaptiveplanet.com
Fri Feb 6 13:45:03 CET 2009


Could it be that stylesheets are not used that way ? 

Have you tried to set the BGC of the parent to something simple using e.g. 
setBackgroundRole call ?

W

On Friday 06 February 2009 13:27:32 Mildred Ki'Lya wrote:
> Hi,
>
> I have a slight problem, I can't make QScrollArea transparent, so the style
> of the parent widget shows through.
>
> The parent widget (objectName="Test") is styled with the following
> stylesheet:
>
> #Test {
>
> background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1,
> stop:0 rgba(255, 236, 131, 255), stop:1 rgba(255, 251, 230, 255));
>
> border: 2px solid rgb(255, 236, 131);
>
> border-radius: 10px;
>
> }
>
> Basically, it sets a gradient for the background. And I would like the
> gradient to show through the QScrollArea, but it only shows a gray
> background.
>
> I tried the following instructions:
>
> scrollArea.setBackgroundRole(QPalette.ColorRole.NoRole);
> scrollArea.setAttribute(WidgetAttribute.WA_NoSystemBackground);
> scrollArea.setAutoFillBackground(false);
>
> but none of them can make the scroll area transparent so it is shows the
> gradient of the parent widget.
>
> Thanks.
>
> Mildred





More information about the Qt-interest-old mailing list