summaryrefslogtreecommitdiff
path: root/src/svg
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2016-12-20 07:12:56 +0100
committerAndy Shaw <andy.shaw@qt.io>2017-01-05 09:34:40 +0000
commit5f5b5f58a976825c883a772d19beac21aaf4dd1d (patch)
tree3e5b239cfc278cda5d85c6ebefde834aa7e7d58e /src/svg
parentc59f33fd5d2cda3e3c9eecbdb71b9b14ec96ec1f (diff)
downloadqtsvg-5f5b5f58a976825c883a772d19beac21aaf4dd1d.tar.gz
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 <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/svg')
-rw-r--r--src/svg/qsvgwidget.cpp4
1 files changed, 4 insertions, 0 deletions
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);
}