[Qt-interest] make QScrollArea transparent

Mildred Ki'Lya ml.mildred593 at gmail.com
Fri Feb 6 13:27:32 CET 2009


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090206/11d30b8b/attachment.html 


More information about the Qt-interest-old mailing list