mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Convenience function to run the image popup
This commit is contained in:
parent
209f04025f
commit
a3ae1ad46e
@ -336,14 +336,19 @@ class ImagePopup:
|
||||
self.dialogs.remove(d)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
|
||||
def show_image(path=None):
|
||||
if path is None:
|
||||
import sys
|
||||
path = sys.argv[-1]
|
||||
from calibre.gui2 import Application
|
||||
app = Application([])
|
||||
p = QPixmap()
|
||||
p.load(sys.argv[-1])
|
||||
u = QUrl.fromLocalFile(sys.argv[-1])
|
||||
p.load(path)
|
||||
u = QUrl.fromLocalFile(path)
|
||||
d = ImageView(None, p, u)
|
||||
d()
|
||||
app.exec()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
show_image()
|
||||
|
Loading…
x
Reference in New Issue
Block a user