[PySide] trouble with special characters in widget.setToolTip()

Stephan Deibel sdeibel at wingware.com
Thu Mar 3 14:20:09 CET 2016

Frank Rueter | OHUfx wrote:
> Hm, I'm not having much luck. Apparently my tooltip and default font 
> is Lucida Grande when running the code inside Wing, which should be 
> able to display quotation marks. I tried changing the font to Verdana, 
> as that is what my host application is using (where I get the corrcet 
> characters), but to no avail.
> I tried using QtGui.QToolTip.setFont() and QApplication().setFont() 
> but I was still left with the wrong characters.
> Any more ideas?

In Wing, if you are doing this in a shell, the encoding options on the 
Debugger > I/O preferences page may be relevant.  Also, if the strings 
are in a source file, use a coding comment at the top of the Python file 
(like "#coding:utf-8"; Wing converts the file if you change or add this) 
and be sure you're sending correctly encoded strings or unicode strings 
to PySide.  The font can matter if it's missing the necessary unicode 
glyphs but that probably isn't the issue in this case.

- Stephan

More information about the PySide mailing list