summaryrefslogtreecommitdiff
path: root/Source/WebKit2/qt/MainQt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/qt/MainQt.cpp')
-rw-r--r--Source/WebKit2/qt/MainQt.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/Source/WebKit2/qt/MainQt.cpp b/Source/WebKit2/qt/MainQt.cpp
index 1e1ce2b3d..17ad8537d 100644
--- a/Source/WebKit2/qt/MainQt.cpp
+++ b/Source/WebKit2/qt/MainQt.cpp
@@ -42,8 +42,8 @@ typedef QApplication ApplicationType;
namespace WebKit {
Q_DECL_IMPORT int WebProcessMainQt(QGuiApplication*);
-#if defined(HAVE_WEBKIT1)
-Q_DECL_IMPORT void initializeWebKit2Theme();
+#if !defined(QT_NO_WIDGETS)
+Q_DECL_IMPORT void initializeWebKitWidgets();
#endif
}
@@ -82,15 +82,20 @@ int main(int argc, char** argv)
}
#endif
-#if defined(HAVE_WEBKIT1)
- WebKit::initializeWebKit2Theme();
-#endif
-
// Has to be done before QApplication is constructed in case
// QApplication itself produces debug output.
QByteArray suppressOutput = qgetenv("QT_WEBKIT_SUPPRESS_WEB_PROCESS_OUTPUT");
if (!suppressOutput.isEmpty() && suppressOutput != "0")
qInstallMessageHandler(messageHandler);
- return WebKit::WebProcessMainQt(new ApplicationType(argc, argv));
+ // QApplication must be created before we call initializeWebKitWidgets() so that
+ // the standard pixmaps can be fetched from the style.
+ ApplicationType* appInstance = new ApplicationType(argc, argv);
+
+#if !defined(QT_NO_WIDGETS)
+ if (qgetenv("QT_WEBKIT_THEME_NAME") == "qstyle")
+ WebKit::initializeWebKitWidgets();
+#endif
+
+ return WebKit::WebProcessMainQt(appInstance);
}