just try ..
use
void QPainter::setOpacity ( qreal opacity )
Qt Code:
  1. in paintEvent()
  2. {
  3.  
  4. painter->setOpacity(opacity);
  5. }
  6.  
  7.  
  8. in void TransparentWindow::setOpaque()
  9. {
  10. opacity = 0.2;
  11. update();
  12. }
To copy to clipboard, switch view to plain text mode