Permalink
Browse files

[Linux] Use our platform plugin instead of offscreen

We cant't use offscreen plugin because we need system fonts without setting
up an environment variable. Plus we also need custom resolution and DPI.
  • Loading branch information...
1 parent c4d528e commit 1ae162c00e92b4db39b79e87a9cf953750b2d6dd @Vitallium Vitallium committed Nov 28, 2016
Showing with 15 additions and 3 deletions.
  1. +5 −2 phantomjs.pro
  2. +4 −1 src/main.cpp
  3. +5 −0 src/phantomjs.pro
  4. +1 −0 src/qt-qpa-platform-plugin/phantom.pro
View
@@ -1,8 +1,11 @@
TEMPLATE = subdirs
CONFIG += ordered
-!win {
+linux {
SUBDIRS += $$PWD/src/qt-qpa-platform-plugin/phantom.pro
}
-
SUBDIRS += $$PWD/src/phantomjs.pro
+
+linux {
+ phantomjs.depends = phantom
+}
View
@@ -32,16 +32,19 @@
#include "crashdump.h"
#include <QApplication>
+#include <QtPlugin>
#include <QSslSocket>
#include <QWebSettings>
#include <stdio.h>
+Q_IMPORT_PLUGIN(PhantomIntegrationPlugin);
+
static int inner_main(int argc, char** argv)
{
#ifdef Q_OS_LINUX
// override default Qt platform plugin
- qputenv("QT_QPA_PLATFORM", "offscreen");
+ qputenv("QT_QPA_PLATFORM", "phantom");
#endif
QApplication app(argc, argv);
View
@@ -94,8 +94,13 @@ win32-msvc* {
}
}
+include($$PWD/qt-qpa-platform-plugin/phantom.pri)
+
linux {
CONFIG += c++11
+ QTPLUGIN.platforms = -
+ LIBS += -L$$PWD/qt-qpa-platform-plugin/plugins/platforms
+ LIBS += -lqphantom
}
openbsd* {
@@ -1,4 +1,5 @@
TARGET = qphantom
+CONFIG += static
PLUGIN_TYPE = platforms
PLUGIN_CLASS_NAME = PhantomIntegrationPlugin

0 comments on commit 1ae162c

Please sign in to comment.