summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-05 11:25:08 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-05 11:25:08 (GMT)
commitbc38aa480d412e498e6f0561305bae0bf51fbce9 (patch)
tree9efe7d6012947ddbd7fb7afc7eb59ee3baceb74c
parentbb7f48138f0ba14a8cdda8926147a4c1f3ff4cbc (diff)
Add support for printing PrintElementBackgrounds
-rw-r--r--messageviewer/src/viewer/webengine/mailwebenginepage.cpp7
-rw-r--r--messageviewer/src/viewer/webengine/mailwebenginepage.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/messageviewer/src/viewer/webengine/mailwebenginepage.cpp b/messageviewer/src/viewer/webengine/mailwebenginepage.cpp
index 361a69e..1c4a28b 100644
--- a/messageviewer/src/viewer/webengine/mailwebenginepage.cpp
+++ b/messageviewer/src/viewer/webengine/mailwebenginepage.cpp
@@ -57,3 +57,10 @@ void MailWebEnginePage::initialize()
settings()->setFontFamily(QWebEngineSettings::StandardFont, font.family());
settings()->setFontSize(QWebEngineSettings::DefaultFontSize, font.pixelSize());
}
+
+void MailWebEnginePage::setPrintElementBackground(bool printElementBackground)
+{
+#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
+ settings()->setAttribute(QWebEngineSettings::PrintElementBackgrounds, printElementBackground);
+#endif
+}
diff --git a/messageviewer/src/viewer/webengine/mailwebenginepage.h b/messageviewer/src/viewer/webengine/mailwebenginepage.h
index 62f1bde..d42e02c 100644
--- a/messageviewer/src/viewer/webengine/mailwebenginepage.h
+++ b/messageviewer/src/viewer/webengine/mailwebenginepage.h
@@ -32,6 +32,8 @@ public:
explicit MailWebEnginePage(QWebEngineProfile *profile, QObject *parent = Q_NULLPTR);
~MailWebEnginePage();
+ void setPrintElementBackground(bool printElementBackground);
+
private:
void initialize();
};