From 5f5b5f58a976825c883a772d19beac21aaf4dd1d Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 20 Dec 2016 07:12:56 +0100 Subject: Paint the background if one has been set via a stylesheet for the widget If there is no stylesheet set then this is a no-op, it ensures that this much of the stylesheet is still utilized when one is set. Change-Id: I6f3c15b2ddf89d8e4471acf094a48141ff06d511 Reviewed-by: Eirik Aavitsland --- src/svg/qsvgwidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/svg/qsvgwidget.cpp b/src/svg/qsvgwidget.cpp index 3881484..4b86306 100644 --- a/src/svg/qsvgwidget.cpp +++ b/src/svg/qsvgwidget.cpp @@ -43,6 +43,7 @@ #include "qsvgrenderer.h" +#include "qstyleoption.h" #include "qpainter.h" #include "private/qwidget_p.h" @@ -145,7 +146,10 @@ QSize QSvgWidget::sizeHint() const void QSvgWidget::paintEvent(QPaintEvent *) { Q_D(QSvgWidget); + QStyleOption opt; + opt.init(this); QPainter p(this); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); d->renderer->render(&p); } -- cgit v1.2.1