mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-21 14:30:57 -04:00
PyQt6 makes exec_() no longer available as an alias for exec(). Just to waste my time, I suppose.
22 lines
536 B
Python
22 lines
536 B
Python
#!/usr/bin/env python
|
|
# vim:fileencoding=utf-8
|
|
# License: GPL v3 Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net>
|
|
|
|
|
|
from qt.core import QUrl
|
|
from qt.webengine import QWebEngineView
|
|
|
|
from calibre.gui2 import Application
|
|
|
|
|
|
def main(url):
|
|
# This function is run in a separate process and can do anything it likes,
|
|
# including use QWebEngine. Here it simply opens the passed in URL
|
|
# in a QWebEngineView
|
|
app = Application([])
|
|
w = QWebEngineView()
|
|
w.setUrl(QUrl(url))
|
|
w.show()
|
|
w.raise_()
|
|
app.exec()
|