I want to remove the background of my QListView so that the background below can be seen through. How can I do that?
I tried setAttribute(Qt::WA_NoSystemBackground)
and setAttribute(Qt::WA_NoBackground)
but that didn't change anything. Also I cannot override paintEvent()
otherwise it doesn't draw the items.
Any idea?
Don't forget that QScrollArea, which is base class for QListView contains "another" widget which is called Viewport. It can be accesed via viewport() method.
To achieve transparency You can simply just call:
viewport()->setAutoFillBackground( false );
and depending on other setting (i.e. parent widget settings) You should see background.