def __init__(self, tab, editorPositionToSourceLineFunc, sourceLineToEditorPositionFunc): QWebEngineView.__init__(self, parent=tab) webPage = ReTextWebEnginePage(self, tab) self.setPage(webPage) self.syncscroll = SyncScroll(webPage, editorPositionToSourceLineFunc, sourceLineToEditorPositionFunc) ReTextWebPreview.__init__(self, tab.editBox)
def __init__(self, tab, editorPositionToSourceLineFunc, sourceLineToEditorPositionFunc): QWebEngineView.__init__(self, parent=tab) webPage = ReTextWebEnginePage(self, tab) self.setPage(webPage) self.syncscroll = SyncScroll(webPage, editorPositionToSourceLineFunc, sourceLineToEditorPositionFunc) ReTextWebPreview.__init__(self, tab.editBox) settings = self.settings() settings.setAttribute(QWebEngineSettings.LocalContentCanAccessFileUrls, False)
def __init__(self, tab, editorPositionToSourceLineFunc, sourceLineToEditorPositionFunc): QWebView.__init__(self) self.tab = tab self.syncscroll = SyncScroll(self.page().mainFrame(), editorPositionToSourceLineFunc, sourceLineToEditorPositionFunc) ReTextWebPreview.__init__(self, tab.editBox) self.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks) self.page().linkClicked.connect(self._handleLinkClicked) self.settings().setAttribute(QWebSettings.LocalContentCanAccessFileUrls, False) # Avoid caching of CSS self.settings().setObjectCacheCapacities(0,0,0)
def __init__(self, tab, editorPositionToSourceLineFunc, sourceLineToEditorPositionFunc): QWebView.__init__(self) self.tab = tab self.syncscroll = SyncScroll(self.page().mainFrame(), editorPositionToSourceLineFunc, sourceLineToEditorPositionFunc) ReTextWebPreview.__init__(self, tab.editBox) self.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks) self.page().linkClicked.connect(self._handleLinkClicked) self.settings().setAttribute( QWebSettings.LocalContentCanAccessFileUrls, False) # Avoid caching of CSS self.settings().setObjectCacheCapacities(0, 0, 0) self.cache = QNetworkDiskCache() cacheDirectory = QStandardPaths.writableLocation( QStandardPaths.CacheLocation) self.cache.setCacheDirectory(cacheDirectory) self.page().networkAccessManager().setCache(self.cache)