How to disable setGraphicsEffect inheritance to children in Qt?
For example, imagine my project has this hierarchy:
When I apply a shadow with setGraphicsEffect to the frame the line edit will inherit that shadow effect, and I don't want that. This is what I'am getting:
As you can see, there's a shadow around the letters of the line edit. Any idea how to fix this?
One more thing.. visibly in the image above the MainWindow has some flags like Qt::FramelessWindowHint and Qt::WA_TranslucentBackground so the frame is supposed to be the "window", and the frame automatically resizes when I resize the MainWindow so I can't change that hierarchy.
As requested by Timusan here is the code of the shadow: Qt: shadow around window
To apply it to the frame:
CustomShadowEffect *shadow = new CustomShadowEffect();
shadow->setColor(c);
shadow->setDistance(scale);
shadow->setBlurRadius(blur_radius);
ui->frame->setGraphicsEffect(shadow);
UPDATE
layout()->addWidget(ui->lineEdit);