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)
|
self.dialogs.remove(d)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
def show_image(path=None):
|
||||||
import sys
|
if path is None:
|
||||||
|
import sys
|
||||||
|
path = sys.argv[-1]
|
||||||
from calibre.gui2 import Application
|
from calibre.gui2 import Application
|
||||||
app = Application([])
|
app = Application([])
|
||||||
p = QPixmap()
|
p = QPixmap()
|
||||||
p.load(sys.argv[-1])
|
p.load(path)
|
||||||
u = QUrl.fromLocalFile(sys.argv[-1])
|
u = QUrl.fromLocalFile(path)
|
||||||
d = ImageView(None, p, u)
|
d = ImageView(None, p, u)
|
||||||
d()
|
d()
|
||||||
app.exec()
|
app.exec()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
show_image()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user