Hi,

The effect is applied to the widget including all its children. In your example 
m_effect1 is getting applied both to pushButton and stackedWidget. Having 
m_effect2 on pushButton introduces the warnings since nested effects are not 
really supported but that is not what you want anyway.

Try making pushButton not to be a child of stackedWidget.

Best regards,
Laszlo

From: interest-bounces+laszlo.agocs=digia....@qt-project.org 
[mailto:interest-bounces+laszlo.agocs=digia....@qt-project.org] On Behalf Of 
bob smith
Sent: 28. november 2013 10:35
To: interest@qt-project.org
Subject: [Interest] Beginning with graphics effects

Hi
I apologies if this message appears twice -
was having problems registering with list (I surely am a noob!)

I am new to Qt and have started playing with graphics effect and cannot quite 
achieve what I want.
I have a an object of type QWidget that has a QButton as a child.
I want to apply a different effect to the QWidget and the button -

    m_effect1 = new QGraphicsOpacityEffect();
    m_effect2 = new QGraphicsOpacityEffect();

    m_effect1->setOpacity(1.0);
    m_effect2->setOpacity(1.0);

    ui.pushButton->setGraphicsEffect(m_effect2);
    ui.stackedWidget->setGraphicsEffect(m_effect1);

When I run the Qt complains the a paint device can only be painted by one 
painter at a time

Could anyone be kind enough to help me?

Thanks

Bob
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to