def render(self): QWebSettings.clearMemoryCaches() try: mybuffer = self.xmlbuffer self.view.setContent(mybuffer, self.mime, self.baseurl) except Exception as e: self.view.setHtml( "Unexpected error:" + handle_except(e) )
def show_graph(self): GeosismaWebForm = 'GeosismaSchedaAgibilita.html' template_path = os.path.dirname(os.path.realpath(__file__))+'/template/'+GeosismaWebForm # create webview clearing cache # js-python connector is insude WebView Class self.dlg = GeosismaOfflineDlg() #self.web = WebPage() # load content QWebSettings.clearMemoryCaches() self.dlg.ui.webView.load(QUrl(template_path)) self.dlg.show()
def exec_(self): GeosismaWebForm = 'GeosismaSchedaAgibilita.html' template_path = os.path.join( os.path.dirname(os.path.realpath(__file__)), 'template', GeosismaWebForm) # create webview clearing cache # js-python connector is inside WebView Class # load content QWebSettings.clearMemoryCaches() url = QUrl.fromLocalFile( template_path ) # necessary to be compatible among different way to refer resources (e.g. windows y linux) self.webView.load(url) self.show()
def __repaint__(self): global _progress, f if len(Visum.Graphic.Backgrounds.GetAll) != len(Paths["Images"]): self.__rebuild_paths__() if _progress == 0: f = open(filename, "a") f.write("Doing repaint...\n") f.close() QWebSettings.clearMemoryCaches() timer = QTimer() timer.start(100) QObject.connect(timer, SIGNAL("timeout()"), self.__update_progress_bar__) Main(self.comboBox.currentIndex(), Visum.Graphic.GetWindow(), self.slider.value() / 4.0, self.__get_net_size__()) Visum.Graphic.Draw() self.__update_progress_bar__() _progress = 0 QTimer().singleShot(1500, self.__update_progress_bar__) f = open(filename, "a") f.write("End of doing repaint.\n") f.close()
def reset_browser(self): """ This function clears the history and resets the UI. It's called whenever the inactivity filter times out, Or when the user clicks the "finished" button when in 'reset' mode. """ # Clear out the memory cache QWebSettings.clearMemoryCaches() self.browser_window.history().clear() # self.navigation_bar.clear() doesn't do its job, #so remove the toolbar first, then rebuild the UI. debug("RESET BROWSER") if self.event_filter: self.event_filter.blockSignals(True) if self.screensaver_active is True: self.screensaver_active = False self.disconnect(self.event_filter, SIGNAL("activity"), self.reset_browser) if self.event_filter: self.event_filter.blockSignals(False) if hasattr(self, "navigation_bar"): self.removeToolBar(self.navigation_bar) self.build_ui(self.options, self.configuration)
def clear_caches(): QWebSettings.clearMemoryCaches()