From 0a5dc07da1cb0f9409803b4df1a92e497e3c0e95 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Wed, 19 Jun 2019 11:04:06 -0400 Subject: [PATCH] fix qt 5.13 compatibility In https://github.com/qt/qtbase/commit/01e1df90a7debd333314720fdd5cf6cd9964d796, screenAdded was deprecated, and as of qt 5.13 it is fully removed. Adapt to this change by using the new API in QWindowSystemInterface. --- src/calibre/headless/headless_integration.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/calibre/headless/headless_integration.cpp b/src/calibre/headless/headless_integration.cpp index 7dc2fce583df..c35bb52dd38a 100644 --- a/src/calibre/headless/headless_integration.cpp +++ b/src/calibre/headless/headless_integration.cpp @@ -64,7 +64,12 @@ HeadlessIntegration::HeadlessIntegration(const QStringList ¶meters) mPrimaryScreen->mDepth = 32; mPrimaryScreen->mFormat = QImage::Format_ARGB32_Premultiplied; +#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)) + QWindowSystemInterface::handleScreenAdded(mPrimaryScreen); +#else screenAdded(mPrimaryScreen); +#endif + #ifdef __APPLE__ #if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)) m_fontDatabase.reset(new QCoreTextFontDatabaseEngineFactory());