[PyQt] images in PyQt QTextEdit widgets

Greg Smith gsmith at troublemakerstudios.com
Thu Jun 11 01:49:44 BST 2009


Hey everyone, I am having a bit of a problem when trying to display a
jpg thumbnail image in a QTextEdit widget. I have a function that builds
an html string that has includes the image as well as some properties
regarding the image sequence that the thumbnail represents. Once the
string has been created I use the setHtml() method to set the string as
the contents of the QTextEdit. When I run my tool, I get all the text
information, but a broken image icon is displayed instead. 

 

The part that mystifies me is that the html string I created is based
off of what worked in the Qt Designer when I made the ui, once I got a
stand in to look right I simply copied the source html and used it as
the foundation of my method. 

 

The image or images in question are located on our file server which is
accessed in a typical UNC fashion, OS is WinXp x64. 

The example source code that worked looked a bit like
so:"/////bright1/shows/stu... ../myImage.jpg".  Which I tried in my
code, but no workie. I've tried "//bright1/shows....",
"file://///bright1/shows..",  even "/bright1/shows....", but it seams
that no matter what I try the image won't show. So I am kind puzzled to
why I can get a picture to work in Designer, but when I try to get it to
work at runtime of my tool. It doesn't.

 

Anyone have any ideas?

 

Greg

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090611/161fd1e5/attachment.html


More information about the PyQt mailing list