QScrollArea with transparent background
I would like to check if I'm doing it correctly. Advises are welcome.
I have a set o widgets which I want to layout horizontally, as they are many and occupies lot of space I use a QScrollArea to accommodate them.
Then I put the QWidget which has the QScrollArea in another QWidget.
And finally, that last QWidget is inserted in a QTabWidget.
The problem I see is:
The tabWidget has a white background and the scrollAreaWidgetContents has a gray background. With the intention of solve this I tried ui->scrollAreaWidgetContents->setAttribute(Qt::WA_TranslucentBackground), but all the scrollArea contents get trashed when moving the scroll.
Re: QScrollArea with transparent background
What exactly is the effect you want to obtain? Do you wish to get rid of the gray background?
Re: QScrollArea with transparent background
Re: QScrollArea with transparent background
Did you try setting the background color to Qt::Transparent or making sure autofillBackground is set to false? In general I tried to repeat the problem you are having using Qt Designed but everything works for me as expected. Can you provide a minimal compilable example reproducing the problem?
1 Attachment(s)
Re: QScrollArea with transparent background
Please find a compilable example attached.
I tried both. Setting the background color to Qt::Transparent makes even the buttons and scrollbar transparent, which I didn't want.