[PyKDE] QTextBrowser: no mimesource for
Martin.Zohlhuber at tttech.com
Martin.Zohlhuber at tttech.com
Tue Mar 30 10:41:04 BST 2004
Hello
I want show html file (from internet and local filesystem) in my PyQT
application.
QTextBrowser-Widget should do it.
When i load (setSource) a html i get always:
"QTextBrowser: no mimesource for x.html"
and a blank Textbrowser.
I test a few things (set my own mimefactory.....) but i get always the
same result. I search within internet and found 6 similar postings on
different mailinglist/newsgroup, but no answer or working codeexample.
What's wrong ?
Please help me.
Please post a working code example if possible.
Thanks for every suggestion !
martin
PS: Work on Win2k with current Qt-Evaluation-version and
PyQt-win-edu-msvc-3.11.exe
--------------------------------
My test-code equal to official "Simple HTML Help Browser" C++ Example:
import qt
import sys
app = qt.QApplication (sys.argv)
main = qt.QMainWindow ()
filename = qt.QDir( qt.QString("./x.html") ).absPath()
browser = qt.QTextBrowser (main)
browser.mimeSourceFactory().setFilePath(qt.QStringList("."))
# browser->setFrameStyle( QFrame::Panel | QFrame::Sunken );
browser.setSource( filename)
browser.setFocus()
main.setCentralWidget (browser)
app.setMainWidget (main)
main.show ()
app.exec_loop ()
More information about the PyQt
mailing list