Hi,

I have a transparent QTextEdit in a widget that has a image background. The only code that I have is to make the backgriound:

Qt Code:
  1. void climateCover::resizeEvent ( QResizeEvent * /*event*/ )
  2. {
  3. QString file;
  4. file = ":images/svg/climate.svg";
  5.  
  6. QSvgRenderer svgfile(file,0);
  7. QImage img(this->size().width(), this->size().height(), QImage::Format_ARGB32);
  8. img.fill(0);
  9. QPainter painter(&img);
  10. svgfile.render(&painter);
  11.  
  12. QPalette palette;
  13. setAutoFillBackground(TRUE);
  14. palette.setBrush(QPalette::Window,QPixmap::fromImage(img));
  15.  
  16. setPalette(palette);
  17.  
  18. }
To copy to clipboard, switch view to plain text mode 

The QTextEdit is on the UI of climateCover.

However when I run the application the QTextEdit gets its own copy of the background! See image:

QTextEdit_image1.jpg

The only thing that QTextEdit has is autofillbackground = true and and alpha of 127. I also have a QPushButton with the same characteristics of alpha and it works fine.

Any idea what is wrong?

Thanks,
Carlos.