diff --git a/src/calibre/gui2/viewer/web_view.py b/src/calibre/gui2/viewer/web_view.py index 0dcb91c6f1..a38bf13338 100644 --- a/src/calibre/gui2/viewer/web_view.py +++ b/src/calibre/gui2/viewer/web_view.py @@ -9,7 +9,7 @@ import sys from itertools import count from PyQt5.Qt import ( - QApplication, QBuffer, QByteArray, QFontDatabase, QFontInfo, QHBoxLayout, QSize, + QApplication, QBuffer, QByteArray, QFontDatabase, QFontInfo, QHBoxLayout, QSize, QT_VERSION, Qt, QTimer, QUrl, QWidget, pyqtSignal ) from PyQt5.QtWebEngineCore import QWebEngineUrlSchemeHandler @@ -581,6 +581,7 @@ class WebView(RestartingWebEngineView): 'ui_font_sz': '{}px'.format(fi.pixelSize()), 'show_home_page_on_ready': self.show_home_page_on_ready, 'system_colors': system_colors(), + 'QT_VERSION': QT_VERSION, } self.bridge.create_view( vprefs['session_data'], vprefs['local_storage'], field_metadata.all_metadata(), ui_data) diff --git a/src/pyj/read_book/globals.pyj b/src/pyj/read_book/globals.pyj index 3b5175ee56..a5ead3463c 100644 --- a/src/pyj/read_book/globals.pyj +++ b/src/pyj/read_book/globals.pyj @@ -81,6 +81,7 @@ runtime = { 'is_standalone_viewer': False, 'viewer_in_full_screen': False, 'in_develop_mode': IN_DEVELOP_MODE is '1', + 'QT_VERSION': 0, } diff --git a/src/pyj/viewer-main.pyj b/src/pyj/viewer-main.pyj index 2393d45aff..3aa54d23cc 100644 --- a/src/pyj/viewer-main.pyj +++ b/src/pyj/viewer-main.pyj @@ -175,6 +175,7 @@ def create_view(prefs, local_storage, field_metadata, ui_data): library_data.field_metadata = field_metadata document.documentElement.style.fontFamily = f'"{ui_data.ui_font_family}", sans-serif' document.documentElement.style.fontSize = ui_data.ui_font_sz + runtime.QT_VERSION = ui_data.QT_VERSION if view is None: create_session_data(prefs, local_storage) view = View(document.getElementById('view'))