qlands
7th October 2011, 08:08
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:
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::fromIma ge(img));
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:
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.
I have a transparent QTextEdit in a widget that has a image background. The only code that I have is to make the backgriound:
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::fromIma ge(img));
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:
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.