View Single Post
Old 09-11-2019, 11:46 AM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,384
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No cant say I have an example, but here is a barebones viewer.py to add to your plugin. It only shows a single passed in html file, for breviry

Code:
def main(path_to_html_file, path_to_ther_html_file):
     from calibre.gui2 import Application
    app = Application([])
    w = QWebEngineView()
    w.setUrl(QUril.fromlocalFile(path_to_html_file))
    w.show()
    w.raise_()
    app.exec_()
add it to your plugin as viewer.py and call it using the run_calibre_debug() function I showed you earlier, and there you have a web engine based HTML viewer.
kovidgoyal is offline   Reply With Quote