qt5-webkit-solid_background_PDF.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. From df18029adc431e6f0f3f5cfa47fb09849b2be63a Mon Sep 17 00:00:00 2001
  2. From: Alex Leray <alexandre@stdin.fr>
  3. Date: Wed, 10 Aug 2016 18:40:55 +0200
  4. Subject: [PATCH] Fixes issues with solid background in PDFs.
  5. ---
  6. Source/WebKit/qt/WidgetApi/qwebview.cpp | 5 ++++-
  7. 1 file changed, 4 insertions(+), 1 deletion(-)
  8. diff --git a/Source/WebKit/qt/WidgetApi/qwebview.cpp b/Source/WebKit/qt/WidgetApi/qwebview.cpp
  9. index d97a604261c0..8f5cd207aea2 100644
  10. --- a/Source/WebKit/qt/WidgetApi/qwebview.cpp
  11. +++ b/Source/WebKit/qt/WidgetApi/qwebview.cpp
  12. @@ -28,6 +28,7 @@
  13. #ifndef QT_NO_ACCESSIBILITY
  14. #include "qwebviewaccessible_p.h"
  15. #endif
  16. +#include <qapplication.h>
  17. #include <qbitmap.h>
  18. #include <qdir.h>
  19. #include <qevent.h>
  20. @@ -259,7 +260,9 @@ void QWebView::setPage(QWebPage* page)
  21. if (d->page) {
  22. d->page->setView(this);
  23. - d->page->setPalette(palette());
  24. + QPalette palette = QApplication::palette();
  25. + palette.setBrush(QPalette::Base, QColor::fromRgbF(0, 0, 0, 0));
  26. + d->page->setPalette(palette);
  27. // #### connect signals
  28. QWebFrame *mainFrame = d->page->mainFrame();
  29. connect(mainFrame, SIGNAL(titleChanged(QString)),