crackerbunny
crackerbunny

Reputation: 139

Qt Image From Web

I'd like PyQt to load an image and display it from the web. Dozens of examples I've found online did not work, as they are for downloading the image.

I simply want to view it.

Something like

from PyQt4.QtWebKit import *
web = QWebView()
web.load(QUrl("http://stackoverflow.com/content/img/so/logo.png"))

Upvotes: 2

Views: 2423

Answers (1)

Alex Martelli
Alex Martelli

Reputation: 882691

import sys
from PyQt4 import QtCore, QtGui, QtWebKit

app = QtGui.QApplication(sys.argv) 

web = QtWebKit.QWebView()
web.load(QtCore.QUrl("http://upload.wikimedia.org/wikipedia/commons/a/af/Tux.png"))
web.show()

sys.exit(app.exec_()) 

Upvotes: 5

Related Questions