[PyQt] QFontMetrics.elidedText doesn't seem to be working

Roshan Mathews roshan at tachyontech.net
Tue Jun 23 07:46:08 BST 2009

Roshan Mathews wrote:
> The code below should elide the text in a label if it is longer
> than it's width, and show it with ellipses (...) but it doesn't
> work -- the line `msg = fm.elidedText(...' returns an empty
> QString.
>         msg = fm.elidedText(self.msg, width,
>                             QtCore.Qt.ElideRight)
That should have been
          msg = fm.elidedText(self.msg,

Sorry about that.  This fixes the non-issue.


Roshan Mathews

More information about the PyQt mailing list