views:

468

answers:

1
+1  Q: 

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"))
+4  A: 
import sys
from PyQt4 import QtCore, QtGui, QtWebKit

app = QtGui.QApplication(sys.argv) 

web = QtWebKit.QWebView()
web.load(QtCore.QUrl("http://stackoverflow.com/content/img/so/logo.png"))
web.show()

sys.exit(app.exec_())
Alex Martelli
i just get a blank dialog, is there something missing?
mleep
Works fine here - system Python 2.5.1 on Mac OS X 10.5.7, PyQt 4.1.3 -- what versions/platform have you got?
Alex Martelli
Kubuntu, Python 2.5.1 - executing from Eric4.
mleep
Darn, I have no kubuntu to check (only plain ubuntu and Mac) -- guess you could easily try executing from command line just to ensure eric4's got nothing to do with it...? BTW, what PyQt release?
Alex Martelli