[Interest] Beginning with graphics effects

Agocs Laszlo Laszlo.Agocs at digia.com
Thu Nov 28 11:09:53 CET 2013


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.com at qt-project.org [mailto:interest-bounces+laszlo.agocs=digia.com at qt-project.org] On Behalf Of bob smith
Sent: 28. november 2013 10:35
To: interest at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131128/bb2a3c91/attachment.html>


More information about the Interest mailing list