Here is the full workaround:
Create a CustomStyle class that extends QProxyStyle:
#ifndef CUSTOMSTYLE_H
#define CUSTOMSTYLE_H
#include <QProxyStyle>
#include <QStyleOption>
class CustomStyle : public QProxyStyle
{
void drawControl(ControlElement element, const QStyleOption* option, QPainter* painter, const QWidget* widget = 0) const
{
if (element == QStyle::CE_CheckBox ||
element == QStyle::CE_RadioButton) {
option->styleObject->setProperty("_q_no_animation", true);
}
QProxyStyle::drawControl(element, option, painter, widget);
}
};
#endif //CUSTOMSTYLE_H
Set the CustomStyle to your application or webview component:
// like this
QApplication::setStyle(new CustomStyle());
// or like this
ui->webview->setStyle(new CustomStyle());
Note that your QWebView component must not have its "styleSheet" property set. It must be empty. Otherwise it will somehow override our custom style and the workaround won't work.