[PyKDE] QTextBrowser & QMimeSourceFactory
Pete Ware
ware at cis.ohio-state.edu
Tue Apr 4 19:53:15 BST 2000
Well, I was wrong (big news). It definitely is not a PyQt problem.
Maybe what's more bothersome is I don't understand the qt side of
things.
Assuming you have a file 'doc/help-start.html' that can have links
(<a href='xxx'></a>, the following code makes for a very trivial browser
(see examples/qbrowser/qbrowser for something that can read the Qt
documentation).
#! /usr/bin/env python
import qt
import sys
app = qt.QApplication (sys.argv)
main = qt.QMainWindow ()
text = qt.QTextBrowser (main)
text.mimeSourceFactory().setFilePath (qt.QStringList ('.'))
text.setSource ('doc/help-start.html')
main.setCentralWidget (text)
app.setMainWidget (main)
main.show ()
app.exec_loop ()
More information about the PyQt
mailing list