[Qt-interest] how to make QWidget within QScrollArea transparent?

Matthias Pospiech matthias.pospiech at gmx.de
Sun Aug 1 12:11:32 CEST 2010


I have this code:
    d->scrollArea = new QScrollArea(this);
    d->scrollArea->setFrameShape(QFrame::NoFrame);
    d->scrollArea->setWidgetResizable(true);
    d->scrollAreaWidgetContents = new QWidget();
    d->gridLayoutScrollArea = new QGridLayout(d->scrollAreaWidgetContents);
    d->gridLayoutScrollArea->setContentsMargins(0, 0, 0, 0);

where the scrollArea is placed within a QGroupBox. The Background of the 
Widget where the QGroupBox is placed is structured.
However the QWdiget within the scroll area introduced a uniform colored 
background which does not fit in style.

So how can I make the QWidget transparent? I could not find any 
setTransparent function in QWidget.

Matthias




More information about the Qt-interest-old mailing list