You code for the palette is fine. So try to use
QWidget::autoFillBackground
.
Qt Code:
#include <QtGui> int main ( int argc, char * argv [ ] ) { QWidget w; lcd. setAutoFillBackground ( true ); // see the different if you comment that line out. lcd. setPalette (Pal ); w. show ( ); return app. exec ( ); }