Quellcode durchsuchen

Added support for running on linux without an X server, based on patch by Artur Zaprzala

Jakob Truelsen vor 16 Jahren
Ursprung
Commit
2bf17c671d

+ 64 - 0
qt-no-x11.patch

@@ -0,0 +1,64 @@
+diff -ur qt-x11-opensource-src-4.5.1.orig/src/gui/kernel/qapplication_x11.cpp qt-x11-opensource-src-4.5.1/src/gui/kernel/qapplication_x11.cpp
+--- qt-x11-opensource-src-4.5.1.orig/src/gui/kernel/qapplication_x11.cpp	2009-04-22 01:57:41.000000000 +0200
++++ qt-x11-opensource-src-4.5.1/src/gui/kernel/qapplication_x11.cpp	2009-06-20 14:58:44.986333611 +0200
+@@ -2215,6 +2217,8 @@
+         QSegfaultHandler::initialize(priv->argv, priv->argc);
+ #endif
+         QCursorData::initialize();
++    } else if (!QApplicationPrivate::graphics_system_name.isNull()) {
++        QApplicationPrivate::graphics_system = QGraphicsSystemFactory::create(QApplicationPrivate::graphics_system_name);
+     }
+     QFont::initialize();
+ 
+diff -ur qt-x11-opensource-src-4.5.1.orig/src/gui/styles/qstyle.cpp qt-x11-opensource-src-4.5.1/src/gui/styles/qstyle.cpp
+--- qt-x11-opensource-src-4.5.1.orig/src/gui/styles/qstyle.cpp	2009-04-22 01:57:41.000000000 +0200
++++ qt-x11-opensource-src-4.5.1/src/gui/styles/qstyle.cpp	2009-06-20 12:00:14.946507441 +0200
+@@ -47,6 +47,7 @@
+ #include "qpixmapcache.h"
+ #include "qstyleoption.h"
+ #include "private/qstyle_p.h"
++#include "private/qapplication_p.h"
+ #ifndef QT_NO_DEBUG
+ #include "qdebug.h"
+ #endif
+@@ -2211,7 +2212,7 @@
+ {
+ #ifdef Q_WS_X11
+     QColor background;
+-    if (QX11Info::appDepth() > 8)
++    if (!qt_is_gui_used || QX11Info::appDepth() > 8)
+         background = QColor(0xd4, 0xd0, 0xc8); // win 2000 grey
+     else
+         background = QColor(192, 192, 192);
+diff -ur qt-x11-opensource-src-4.5.1.orig/src/gui/image/qpixmap_raster.cpp qt-x11-opensource-src-4.5.1/src/gui/image/qpixmap_raster.cpp
+--- qt-x11-opensource-src-4.5.1.orig/src/gui/image/qpixmap_raster.cpp	2009-04-22 01:57:41.000000000 +0200
++++ qt-x11-opensource-src-4.5.1/src/gui/image/qpixmap_raster.cpp	2009-06-20 12:00:14.934006602 +0200
+@@ -44,6 +44,7 @@
+ #include "qpixmap_raster_p.h"
+ #include "qnativeimage_p.h"
+ #include "qimage_p.h"
++#include "kernel/qapplication_p.h"
+ 
+ #include "qbitmap.h"
+ #include "qimage.h"
+@@ -89,8 +90,10 @@
+ #else
+     if (pixelType() == BitmapType)
+         format = QImage::Format_MonoLSB;
+-    else
++    else if (qt_is_gui_used)
+         format = QNativeImage::systemFormat();
++    else
++        format = QImage::Format_RGB32;
+ #endif
+ 
+     image = QImage(width, height, format);
+@@ -156,7 +159,7 @@
+                     : sourceImage.convertToFormat(QImage::Format_RGB32);
+         } else {
+ 
+-            QImage::Format opaqueFormat = QNativeImage::systemFormat();
++            QImage::Format opaqueFormat = qt_is_gui_used ? QNativeImage::systemFormat() : QImage::Format_RGB32;
+             QImage::Format alphaFormat = QImage::Format_ARGB32_Premultiplied;
+ 
+             switch (opaqueFormat) {

+ 21 - 12
qt-pdf-outline.patch

@@ -1,6 +1,6 @@
-diff -ur qt-x11-opensource-src-4.5.0-old/src/gui/painting/qprintengine.h qt-x11-opensource-src-4.5.0/src/gui/painting/qprintengine.h
---- qt-x11-opensource-src-4.5.0-old/src/gui/painting/qprintengine.h	2009-02-25 22:09:23.000000000 +0100
-+++ qt-x11-opensource-src-4.5.0/src/gui/painting/qprintengine.h	2009-03-10 20:31:32.000000000 +0100
+diff -ur qt-x11-opensource-src-4.5.1.orig/src/gui/painting/qprintengine.h qt-x11-opensource-src-4.5.1/src/gui/painting/qprintengine.h
+--- qt-x11-opensource-src-4.5.1.orig/src/gui/painting/qprintengine.h	2009-04-22 01:57:41.000000000 +0200
++++ qt-x11-opensource-src-4.5.1/src/gui/painting/qprintengine.h	2009-06-20 12:03:10.154006704 +0200
 @@ -95,6 +95,8 @@
      virtual QVariant property(PrintEnginePropertyKey key) const = 0;
  
@@ -10,9 +10,9 @@ diff -ur qt-x11-opensource-src-4.5.0-old/src/gui/painting/qprintengine.h qt-x11-
      virtual bool abort() = 0;
  
      virtual int metric(QPaintDevice::PaintDeviceMetric) const = 0;
-diff -ur qt-x11-opensource-src-4.5.0-old/src/gui/painting/qprintengine_pdf.cpp qt-x11-opensource-src-4.5.0/src/gui/painting/qprintengine_pdf.cpp
---- qt-x11-opensource-src-4.5.0-old/src/gui/painting/qprintengine_pdf.cpp	2009-02-25 22:09:23.000000000 +0100
-+++ qt-x11-opensource-src-4.5.0/src/gui/painting/qprintengine_pdf.cpp	2009-03-10 20:31:32.000000000 +0100
+diff -ur qt-x11-opensource-src-4.5.1.orig/src/gui/painting/qprintengine_pdf.cpp qt-x11-opensource-src-4.5.1/src/gui/painting/qprintengine_pdf.cpp
+--- qt-x11-opensource-src-4.5.1.orig/src/gui/painting/qprintengine_pdf.cpp	2009-04-22 01:57:41.000000000 +0200
++++ qt-x11-opensource-src-4.5.1/src/gui/painting/qprintengine_pdf.cpp	2009-06-20 14:51:37.922141190 +0200
 @@ -115,6 +115,28 @@
      state = QPrinter::Idle;
  }
@@ -42,7 +42,15 @@ diff -ur qt-x11-opensource-src-4.5.0-old/src/gui/painting/qprintengine_pdf.cpp q
  QPdfEngine::~QPdfEngine()
  {
  }
-@@ -156,6 +178,24 @@
+@@ -122,7 +144,6 @@
+ bool QPdfEngine::begin(QPaintDevice *pdev)
+ {
+     Q_D(QPdfEngine);
+-
+     if(!QPdfBaseEngine::begin(pdev)) {
+         state = QPrinter::Error;
+         return false;
+@@ -156,6 +177,24 @@
  bool QPdfEngine::end()
  {
      Q_D(QPdfEngine);
@@ -67,7 +75,7 @@ diff -ur qt-x11-opensource-src-4.5.0-old/src/gui/painting/qprintengine_pdf.cpp q
      d->writeTail();
  
      d->stream->unsetDevice();
-@@ -305,14 +345,59 @@
+@@ -305,14 +344,59 @@
      stream = new QDataStream;
      pageOrder = QPrinter::FirstPageFirst;
      orientation = QPrinter::Portrait;
@@ -141,9 +149,9 @@ diff -ur qt-x11-opensource-src-4.5.0-old/src/gui/painting/qprintengine_pdf.cpp q
  
      // graphics state
      graphicsState = addXrefEntry(-1);
-diff -ur qt-x11-opensource-src-4.5.0-old/src/gui/painting/qprintengine_pdf_p.h qt-x11-opensource-src-4.5.0/src/gui/painting/qprintengine_pdf_p.h
---- qt-x11-opensource-src-4.5.0-old/src/gui/painting/qprintengine_pdf_p.h	2009-02-25 22:09:23.000000000 +0100
-+++ qt-x11-opensource-src-4.5.0/src/gui/painting/qprintengine_pdf_p.h	2009-03-10 20:31:32.000000000 +0100
+diff -ur qt-x11-opensource-src-4.5.1.orig/src/gui/painting/qprintengine_pdf_p.h qt-x11-opensource-src-4.5.1/src/gui/painting/qprintengine_pdf_p.h
+--- qt-x11-opensource-src-4.5.1.orig/src/gui/painting/qprintengine_pdf_p.h	2009-04-22 01:57:41.000000000 +0200
++++ qt-x11-opensource-src-4.5.1/src/gui/painting/qprintengine_pdf_p.h	2009-06-20 12:03:10.158507555 +0200
 @@ -113,6 +113,8 @@
      QString author() const;
  
@@ -153,7 +161,7 @@ diff -ur qt-x11-opensource-src-4.5.0-old/src/gui/painting/qprintengine_pdf_p.h q
  
  private:
      Q_DISABLE_COPY(QPdfEngine)
-@@ -124,5 +126,34 @@
+@@ -124,6 +126,35 @@
  {
      Q_DECLARE_PUBLIC(QPdfEngine)
  public:
@@ -188,3 +196,4 @@ diff -ur qt-x11-opensource-src-4.5.0-old/src/gui/painting/qprintengine_pdf_p.h q
 +    
      QPdfEnginePrivate(QPrinter::PrinterMode m);
      ~QPdfEnginePrivate();
+ 

+ 7 - 7
qt-webkit-default-encoding.patch

@@ -1,6 +1,6 @@
-diff -ur qt-x11-opensource-src-4.5.0-o/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp qt-x11-opensource-src-4.5.0/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
---- qt-x11-opensource-src-4.5.0-o/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp	2009-04-05 12:42:47.000000000 +0200
-+++ qt-x11-opensource-src-4.5.0/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp	2009-04-05 12:59:36.000000000 +0200
+diff -ur qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
+--- qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp	2009-04-22 01:57:40.000000000 +0200
++++ qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp	2009-06-20 12:21:10.150007711 +0200
 @@ -52,6 +52,7 @@
      QHash<int, int> fontSizes;
      QHash<int, bool> attributes;
@@ -19,7 +19,7 @@ diff -ur qt-x11-opensource-src-4.5.0-o/src/3rdparty/webkit/WebKit/qt/Api/qwebset
          QString localStoragePath = !localStorageDatabasePath.isEmpty() ? localStorageDatabasePath : global->localStorageDatabasePath;
          settings->setLocalStorageDatabasePath(localStoragePath);
  
-@@ -425,6 +429,29 @@
+@@ -424,6 +428,29 @@
  }
  
  /*!
@@ -49,9 +49,9 @@ diff -ur qt-x11-opensource-src-4.5.0-o/src/3rdparty/webkit/WebKit/qt/Api/qwebset
      Sets the path of the icon database to \a path. The icon database is used
      to store "favicons" associated with web sites.
  
-diff -ur qt-x11-opensource-src-4.5.0-o/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h qt-x11-opensource-src-4.5.0/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
---- qt-x11-opensource-src-4.5.0-o/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h	2009-04-05 12:42:47.000000000 +0200
-+++ qt-x11-opensource-src-4.5.0/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h	2009-04-05 12:46:45.000000000 +0200
+diff -ur qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
+--- qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h	2009-04-22 01:57:40.000000000 +0200
++++ qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h	2009-06-20 12:21:10.150007711 +0200
 @@ -95,6 +95,9 @@
      void setUserStyleSheetUrl(const QUrl &location);
      QUrl userStyleSheetUrl() const;

+ 130 - 0
qt-webkit-no-x11.patch

@@ -0,0 +1,130 @@
+diff -ur qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebCore/platform/qt/PlatformScreenQt.cpp qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebCore/platform/qt/PlatformScreenQt.cpp
+--- qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebCore/platform/qt/PlatformScreenQt.cpp	2009-04-22 01:57:40.000000000 +0200
++++ qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebCore/platform/qt/PlatformScreenQt.cpp	2009-06-20 14:33:32.734849089 +0200
+@@ -43,6 +43,7 @@
+ 
+ int screenDepth(Widget* w)
+ {
++    if (QApplication::type()==QApplication::Tty) return 32;
+     QDesktopWidget* d = QApplication::desktop();
+     QWidget *view = w ? w->root()->hostWindow()->platformWindow() : 0;
+     int screenNumber = view ? d->screenNumber(view) : 0;
+@@ -51,12 +52,14 @@
+ 
+ int screenDepthPerComponent(Widget* w)
+ {
++    if (QApplication::type()==QApplication::Tty) return 32;
+     QWidget *view = w ? w->root()->hostWindow()->platformWindow() : 0;
+     return view ? view->depth() : QApplication::desktop()->screen(0)->depth();
+ }
+ 
+ bool screenIsMonochrome(Widget* w)
+ {
++    if (QApplication::type()==QApplication::Tty) return false;
+     QDesktopWidget* d = QApplication::desktop();
+     QWidget *view = w ? w->root()->hostWindow()->platformWindow(): 0;
+     int screenNumber = view ? d->screenNumber(view) : 0;
+@@ -65,12 +68,14 @@
+ 
+ FloatRect screenRect(Widget* w)
+ {
++    if (QApplication::type()==QApplication::Tty) return FloatRect(0,0,800,600);
+     QRect r = QApplication::desktop()->screenGeometry(w ? w->root()->hostWindow()->platformWindow(): 0);
+     return FloatRect(r.x(), r.y(), r.width(), r.height());
+ }
+ 
+ FloatRect screenAvailableRect(Widget* w)
+ {
++    if (QApplication::type()==QApplication::Tty) return FloatRect(0,0,800,600);
+     QRect r = QApplication::desktop()->availableGeometry(w ? w->root()->hostWindow()->platformWindow(): 0);
+     return FloatRect(r.x(), r.y(), r.width(), r.height());
+ }
+diff -ur qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp
+--- qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp	2009-04-22 01:57:40.000000000 +0200
++++ qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp	2009-06-20 14:14:38.030006806 +0200
+@@ -114,22 +114,27 @@
+ RenderThemeQt::RenderThemeQt()
+     : RenderTheme()
+ {
+-    QPushButton button;
+-    button.setAttribute(Qt::WA_MacSmallSize);
+-    QFont defaultButtonFont = QApplication::font(&button);
+-    QFontInfo fontInfo(defaultButtonFont);
+-    m_buttonFontFamily = defaultButtonFont.family();
++    if (QApplication::type()!=QApplication::Tty) {
++        QPushButton button;
++        button.setAttribute(Qt::WA_MacSmallSize);
++        QFont defaultButtonFont = QApplication::font(&button);
++        QFontInfo fontInfo(defaultButtonFont);
++        m_buttonFontFamily = defaultButtonFont.family();
++        // this will need to be regenerated when the style changes
++        QLineEdit lineEdit;
++        QStyleOptionFrameV2 opt;
++        m_frameLineWidth = QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth,
++                                                          &opt, &lineEdit);
++
+ #ifdef Q_WS_MAC
+-    m_buttonFontPixelSize = fontInfo.pixelSize();
++        m_buttonFontPixelSize = fontInfo.pixelSize();
+ #endif
+-
++    } else {
++        m_buttonFontFamily = "sans-serif";
++        m_frameLineWidth = 1;
++    }
+     m_fallbackStyle = 0;
+ 
+-    // this will need to be regenerated when the style changes
+-    QLineEdit lineEdit;
+-    QStyleOptionFrameV2 opt;
+-    m_frameLineWidth = QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth,
+-                                                          &opt, &lineEdit);
+ }
+ 
+ RenderThemeQt::~RenderThemeQt()
+diff -ur qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebCore/platform/qt/ScreenQt.cpp qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebCore/platform/qt/ScreenQt.cpp
+--- qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebCore/platform/qt/ScreenQt.cpp	2009-04-22 01:57:40.000000000 +0200
++++ qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebCore/platform/qt/ScreenQt.cpp	2009-06-20 14:26:25.935256173 +0200
+@@ -54,6 +54,7 @@
+     
+ FloatRect screenRect(const Page* page)
+ {
++    if (QApplication::type()==QApplication::Tty) return FloatRect();
+     QWidget* qw = qwidgetForPage(page);
+     if (!qw)
+         return FloatRect();
+@@ -68,6 +69,7 @@
+ 
+ int screenDepth(const Page* page)
+ {
++    if (QApplication::type()==QApplication::Tty) return 32;
+     QWidget* qw = qwidgetForPage(page);
+     if (!qw)
+         return 32;
+@@ -77,6 +79,7 @@
+ 
+ FloatRect usableScreenRect(const Page* page)
+ {
++    if (QApplication::type()==QApplication::Tty) return FloatRect();
+     QWidget* qw = qwidgetForPage(page);
+     if (!qw)
+         return FloatRect();
+diff -ur qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebCore/platform/qt/WidgetQt.cpp qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebCore/platform/qt/WidgetQt.cpp
+--- qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebCore/platform/qt/WidgetQt.cpp	2009-04-22 01:57:40.000000000 +0200
++++ qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebCore/platform/qt/WidgetQt.cpp	2009-06-20 14:26:39.103281847 +0200
+@@ -44,6 +44,7 @@
+ #include "qwebframe_p.h"
+ #include "qwebpage.h"
+ 
++#include <QApplication>
+ #include <QCoreApplication>
+ #include <QPainter>
+ #include <QPaintEngine>
+@@ -81,6 +82,7 @@
+ void Widget::setCursor(const Cursor& cursor)
+ {
+ #ifndef QT_NO_CURSOR
++    if (QApplication::type()==QApplication::Tty) return;
+     if (QWidget* widget = root()->hostWindow()->platformWindow())
+         QCoreApplication::postEvent(widget, new SetCursorEvent(cursor.impl()));
+ #endif

+ 21 - 12
qt-webkit-print-mediatype.patch

@@ -1,6 +1,6 @@
-diff -ur qt-x11-opensource-src-4.5.0-old/src/3rdparty/webkit/WebCore/page/Frame.cpp qt-x11-opensource-src-4.5.0/src/3rdparty/webkit/WebCore/page/Frame.cpp
---- qt-x11-opensource-src-4.5.0-old/src/3rdparty/webkit/WebCore/page/Frame.cpp	2009-02-25 22:09:20.000000000 +0100
-+++ qt-x11-opensource-src-4.5.0/src/3rdparty/webkit/WebCore/page/Frame.cpp	2009-03-14 10:11:45.000000000 +0100
+diff -ur qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebCore/page/Frame.cpp qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebCore/page/Frame.cpp
+--- qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebCore/page/Frame.cpp	2009-04-22 01:57:40.000000000 +0200
++++ qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebCore/page/Frame.cpp	2009-06-20 12:21:48.626007908 +0200
 @@ -726,13 +726,13 @@
          view()->layout();
  }
@@ -17,9 +17,9 @@ diff -ur qt-x11-opensource-src-4.5.0-old/src/3rdparty/webkit/WebCore/page/Frame.
      d->m_doc->updateStyleSelector();
      forceLayoutWithPageWidthRange(minPageWidth, maxPageWidth, adjustViewSize);
  
-diff -ur qt-x11-opensource-src-4.5.0-old/src/3rdparty/webkit/WebCore/page/Frame.h qt-x11-opensource-src-4.5.0/src/3rdparty/webkit/WebCore/page/Frame.h
---- qt-x11-opensource-src-4.5.0-old/src/3rdparty/webkit/WebCore/page/Frame.h	2009-02-25 22:09:20.000000000 +0100
-+++ qt-x11-opensource-src-4.5.0/src/3rdparty/webkit/WebCore/page/Frame.h	2009-03-14 10:11:52.000000000 +0100
+diff -ur qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebCore/page/Frame.h qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebCore/page/Frame.h
+--- qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebCore/page/Frame.h	2009-04-22 01:57:40.000000000 +0200
++++ qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebCore/page/Frame.h	2009-06-20 12:21:48.626007908 +0200
 @@ -125,7 +125,7 @@
      void setUserStyleSheet(const String& styleSheetData);
  #endif
@@ -29,9 +29,9 @@ diff -ur qt-x11-opensource-src-4.5.0-old/src/3rdparty/webkit/WebCore/page/Frame.
  
      bool inViewSourceMode() const;
      void setInViewSourceMode(bool = true) const;
-diff -ur qt-x11-opensource-src-4.5.0-old/src/3rdparty/webkit/WebCore/page/PrintContext.cpp qt-x11-opensource-src-4.5.0/src/3rdparty/webkit/WebCore/page/PrintContext.cpp
---- qt-x11-opensource-src-4.5.0-old/src/3rdparty/webkit/WebCore/page/PrintContext.cpp	2009-02-25 22:09:20.000000000 +0100
-+++ qt-x11-opensource-src-4.5.0/src/3rdparty/webkit/WebCore/page/PrintContext.cpp	2009-03-14 10:12:43.000000000 +0100
+diff -ur qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebCore/page/PrintContext.cpp qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebCore/page/PrintContext.cpp
+--- qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebCore/page/PrintContext.cpp	2009-04-22 01:57:40.000000000 +0200
++++ qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebCore/page/PrintContext.cpp	2009-06-20 12:21:48.630007375 +0200
 @@ -93,7 +93,7 @@
      } while (printedPagesHeight < docHeight);
  }
@@ -50,9 +50,9 @@ diff -ur qt-x11-opensource-src-4.5.0-old/src/3rdparty/webkit/WebCore/page/PrintC
  }
  
  void PrintContext::spoolPage(GraphicsContext& ctx, int pageNumber, float width)
-diff -ur qt-x11-opensource-src-4.5.0-old/src/3rdparty/webkit/WebCore/page/PrintContext.h qt-x11-opensource-src-4.5.0/src/3rdparty/webkit/WebCore/page/PrintContext.h
---- qt-x11-opensource-src-4.5.0-old/src/3rdparty/webkit/WebCore/page/PrintContext.h	2009-02-25 22:09:20.000000000 +0100
-+++ qt-x11-opensource-src-4.5.0/src/3rdparty/webkit/WebCore/page/PrintContext.h	2009-03-14 10:12:19.000000000 +0100
+diff -ur qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebCore/page/PrintContext.h qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebCore/page/PrintContext.h
+--- qt-x11-opensource-src-4.5.1.orig/src/3rdparty/webkit/WebCore/page/PrintContext.h	2009-04-22 01:57:40.000000000 +0200
++++ qt-x11-opensource-src-4.5.1/src/3rdparty/webkit/WebCore/page/PrintContext.h	2009-06-20 12:21:48.630007375 +0200
 @@ -40,7 +40,7 @@
      void computePageRects(const FloatRect& printRect, float headerHeight, float footerHeight, float userScaleFactor, float& outPageHeight);
  
@@ -62,3 +62,12 @@ diff -ur qt-x11-opensource-src-4.5.0-old/src/3rdparty/webkit/WebCore/page/PrintC
  
      // TODO: eliminate width param
      void spoolPage(GraphicsContext& ctx, int pageNumber, float width);
+@@ -50,6 +50,8 @@
+ protected:
+     Frame* m_frame;
+     Vector<IntRect> m_pageRects;
++public:
++    const Vector<IntRect> & getPageRects() {return m_pageRects;}
+ };
+ 
+ }

+ 1 - 1
static-build.sh

@@ -18,7 +18,7 @@
 # It requires build-essential and wine to run. Please note that it will take quite a while
 
 #Configuration for the static build
-QT=qt-all-opensource-src-4.5.0
+QT=qt-all-opensource-src-4.5.1
 MIRROR=kent
 MINGWFILES="binutils-2.19.1-mingw32-bin.tar.gz mingw32-make-3.81-20080326-3.tar.gz \
 gcc-g++-3.4.5-20060117-3.tar.gz gcc-core-3.4.5-20060117-3.tar.gz w32api-3.13-mingw32-dev.tar.gz \

+ 2 - 1
static_qt_conf_base

@@ -41,7 +41,8 @@
 -qt-libmng
 -qt-libjpeg
 -openssl
-#-openssl-linked
+-graphicssystem raster
+-opensource
 -nomake tools
 -nomake examples
 -nomake demos

+ 6 - 0
wkhtmltopdf.cc

@@ -538,7 +538,13 @@ int main(int argc, char * argv[]) {
 		x.version(stdout);
 		exit(0);
 	}
+#ifdef  __EXTENSIVE_WKHTMLTOPDF_QT_HACK__
+	QApplication::setGraphicsSystem("raster");
+	QApplication a(argc, argv, false); //Construct application, required for printing
+	a.setStyle(new QCommonStyle()); // Plain style
+#else
 	QApplication a(argc,argv); //Construct application, required for printing
+#endif
 	x.init();
 	for(int i=1; i < argc; ++i)
 		if(!strcmp(argv[i],"--read-args-from-stdin")) {