I'm making a game whith QGraphics framework.
When the game finish I want to blur the whole graphicsview and show a widget with some text on top of it.
My simplified code is :
In view :
void GraphicsTraxView::showGameResultWidget(bool res)
{
blurEffect_->setEnabled(true);
WigglyWidget *wigglyWidget = new WigglyWidget(this);
if(res)
wigglyWidget->setText("you win");
else
wigglyWidget->setText("you loose");
wigglyWidget->resize(150,150);
wigglyWidget->move(QPoint(
getScreenSize().width() / 2 -75, getScreenSize().height() / 2-75));
wigglyWidget->show();
}
In text widget :
void WigglyWidget::paintEvent(QPaintEvent * /* event */)
{
QColor backgroundColor = palette().light().color();
backgroundColor.setAlpha(220);
QPainter customPainter(this);
customPainter.fillRect(rect(), backgroundColor);
//...
But as you can see in image bellow text become blur and unreadable with view too.
How can I remove graphicsEffect
from child widget and still keep background color of my widget semi transparent ?