pyqt4: how to see QWebPage?
I am new at QT, found some code that do what I need (some web-browsing things), it uses QWebPage to get get pages, but it does not make windows to see it. I tried to use example from Russian wiki (it works):
import sys from PyQt4.QtGui import * application = QApplication(sys.argv) widget = QWidget() widget.resize(320, 240) widget.setWindowTitle("Hello, World!") widget.show() sys.exit(application.exec_())
And this points: QWebPage inherit QObject, QObject inherit QWidget
browser = QWebPage() browser.show()
I get AttributeError: 'QWebPage' object has no attribute 'show'
QObject inherits QWidget
No, It doesn't - QWidget inherits QObject, not the other way around. QWebPage is just a data object. You need a QWebView which inherits QWidget and is the widget used for displaying QWebPages:
browser = QWebView() browser.show()