QGraphicsColorizeEffect resizes widgets
-
Hi,
Do you mean you have that effect once you start changing the effect strength ?
-
Not at first.
This is the sequence of events:- call constructor
- set stength to zero
- setEffect on widget
- change strength to larger than zero
at the last point problems happen
-
What does the error messages
QPainter::begin: A paint device can only be painted by one painter at a time. QPainter::translate: Painter not active
mean?
-
@Jakob-Clausen Do you have more than one painter on same device?
-
@jsulm Good question. I was wondering the same thing. It looks like a painter is added, when I set the graphics effect. Is this true?
The widget upon which the effect is set, is also added to a qstackedwidget. Could that cause the ... no more than one painter ... thing? If I add the effect to the qstackedwidget aka the parent, then this error also is no more.
But it still does not look right.
Do I need to repaint the widget? -
Something else is strange. Maybe a clue?
The navigation looks like it only has three buttons left. But all six of them are there. I can push them all, and the QWidgetStack changes accordingly. So the buttons are where they should be. But it looks like they are not.
And if I remove the effect, then I can make it all look well by calling repaint(). -
Are there any limitations on the QGraphicsColorizeEffect?
Should it not be possible to just set it on any old widget? -
@Jakob-Clausen Do you paint manually on that widget (in paintEvent)?
-
No. I add subwidgets to a layout and thats it.
-
I think I have found a way through it all. I can create a new widget of the same size and shape, and instead of a QGraphicsColorizeEffect I can use a QOpacityEffect and the move it to cover the navigationbar. But then the navigation wont accept touch events. Any around that?