Fix building with Qt 5.3.x

This commit is contained in:
Kovid Goyal 2015-03-13 09:26:40 +05:30
parent 6f3c07341f
commit e0e1dbc638
2 changed files with 11 additions and 2 deletions

View File

@ -492,17 +492,21 @@ class Build(Command):
def build_headless(self): def build_headless(self):
if iswindows or isosx: if iswindows or isosx:
return # Dont have headless operation on these platforms return # Dont have headless operation on these platforms
from PyQt5.QtCore import QT_VERSION
self.info('\n####### Building headless QPA plugin', '#'*7) self.info('\n####### Building headless QPA plugin', '#'*7)
a = Extension.absolutize a = Extension.absolutize
headers = a([ headers = a([
'calibre/headless/headless_backingstore.h', 'calibre/headless/headless_backingstore.h',
'calibre/headless/headless_integration.h', 'calibre/headless/headless_integration.h',
'calibre/headless/fontconfig_database.h']) ])
sources = a([ sources = a([
'calibre/headless/main.cpp', 'calibre/headless/main.cpp',
'calibre/headless/headless_backingstore.cpp', 'calibre/headless/headless_backingstore.cpp',
'calibre/headless/headless_integration.cpp', 'calibre/headless/headless_integration.cpp',
'calibre/headless/fontconfig_database.cpp']) ])
if QT_VERSION >= 0x50401:
headers.extend(a(['calibre/headless/fontconfig_database.h']))
sources.extend(a(['calibre/headless/fontconfig_database.cpp']))
others = a(['calibre/headless/headless.json']) others = a(['calibre/headless/headless.json'])
target = self.dest('headless') target = self.dest('headless')
if not self.newer(target, headers + sources + others): if not self.newer(target, headers + sources + others):

View File

@ -1,6 +1,11 @@
#include <QtGlobal>
#include "headless_integration.h" #include "headless_integration.h"
#include "headless_backingstore.h" #include "headless_backingstore.h"
#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 1))
#include "fontconfig_database.h" #include "fontconfig_database.h"
#else
#include <QtPlatformSupport/private/qfontconfigdatabase_p.h>
#endif
#ifndef Q_OS_WIN #ifndef Q_OS_WIN
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h> #include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
#else #else