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:
{
file = ":images/svg/climate.svg";
QImage img
(this
->size
().
width(), this
->size
().
height(),
QImage::Format_ARGB32);
img.fill(0);
svgfile.render(&painter);
setAutoFillBackground(TRUE);
setPalette(palette);
}
void climateCover::resizeEvent ( QResizeEvent * /*event*/ )
{
QString file;
file = ":images/svg/climate.svg";
QSvgRenderer svgfile(file,0);
QImage img(this->size().width(), this->size().height(), QImage::Format_ARGB32);
img.fill(0);
QPainter painter(&img);
svgfile.render(&painter);
QPalette palette;
setAutoFillBackground(TRUE);
palette.setBrush(QPalette::Window,QPixmap::fromImage(img));
setPalette(palette);
}
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.
Bookmarks