Search code examples
qtattributesunsetsetattribute

How to unset a Qt attribute


I am setting an attribute using setAttribute( Qt::WA_OpaquePaintEvent ); Is there a way I can unset this attribute? Or is there a default attribute that I need to set to get it back to the way it was? Thanks.


Solution

  • Just use the second parameter,

    setAttribute(Qt::WA_OpaquePaintEvent , false)

    See http://doc.qt.io/qt-5/qwidget.html#setAttribute