1 Attachment(s)
Wierd behaviour of transparent QTextEdit
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:
Code:
{
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);
}
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:
Attachment 6947
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.
Re: Wierd behaviour of transparent QTextEdit
Did you try setting the background of the text edit to transparent? I think by default it inherits the palette from its parent and thus you end up with the same image as the background.
By the way, wouldn't it be easier to draw the image in the paint event for the widget instead of setting it to the palette of the widget?