Hi Guys, I would like to display a QLCDWidget with no background. Eventually I will make it frameless as well (so it's just a floating number), but I haven't been able to get rid of the background yet. The background show up black, rather than being absent:

Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication app(argc, argv);
  4.  
  5. //Set up the QLCDNumber
  6. QLCDNumber* lcdNumber = new QLCDNumber(3,0);
  7. lcdNumber->display(123);
  8. lcdNumber->setSegmentStyle(QLCDNumber::Flat);
  9.  
  10. //A palette with crazy colors to help see what's going on
  11. //Setting the background to Qt::transpatent here didn't seem to help
  12. QPalette palette = lcdNumber->palette();
  13. palette.setColor(QPalette::Active, QPalette::WindowText, Qt::green);
  14. palette.setColor(QPalette::Active, QPalette::Window, Qt::red);
  15. palette.setColor(QPalette::Inactive, QPalette::WindowText, Qt::blue);
  16. palette.setColor(QPalette::Inactive, QPalette::Window, Qt::yellow);
  17. lcdNumber->setPalette(palette);
  18.  
  19. //The following code should supress the background?
  20. //Also tried setAutoFillBackground instead of Qt::WA_OpaquePaintEvent
  21. //lcdNumber->setAutoFillBackground(true);
  22. lcdNumber->setAttribute(Qt::WA_OpaquePaintEvent, true);
  23. lcdNumber->setAttribute(Qt::WA_NoBackground, true);
  24. lcdNumber->setAttribute(Qt::WA_NoSystemBackground, true);
  25.  
  26. //Show the widget
  27. lcdNumber->show();
  28. return app.exec();
  29. }
To copy to clipboard, switch view to plain text mode 

And the result is:



Any ideas how to get rid of the background?

Thanks!

David