I've got a requirement to display several tabs of icons on a nice textured background. My initial approach is a QTabWidget with a QFrame on each pane. The frame backgrounds are set as follows and are working fine:
QPalette p;
p.setBrush ( this->backgroundRole ( ), QBrush ( QImage ( ":/themes/themes/dark/mw_background.png" ) ) );
frameTab0->setPalette ( p );
frameTab1->setPalette ( p );
Next, I've placed a QListWidget into each of the frames (Icon View Mode, AutoFillBackground = true). I would like to see the QFrame texture through the QListWidget (everywhere there is no icon, like in Konqueror with a background texture active). For the life of me I can't achieve my goal.
I have tried this code thinking QListWidget might inherit its parent's background:
listWidgetTab0->setBackgroundRole ( QPalette::NoRole );
I have also dispensed with the QFrame (placing QListWidget directly onto the QTabWidget panes) and tried to apply the texture directly as follows:
QPalette p;
p.setBrush ( this->backgroundRole ( ), QBrush ( QImage ( ":/themes/themes/dark/mw_background.png" ) ) );
listWidgetTab0->setPalette ( p );
listWidgetTab1->setPalette ( p );
QListWidget background remains a solid color rather than taking the pixmap as QFrame. Any suggestions as to what I'm doing wrong? Advice appreciated.
Platform is Qt 4.3.3 X11.
Bill
Bookmarks