[PyQt] Uppercase QLineEdit

David Boddie david at boddie.org.uk
Mon Jan 25 18:57:10 GMT 2010


On Mon Jan 25 16:48:44 GMT 2010, Mads Ipsen wrote:

> but how do I do something similar in PyQt, where it's not obvious how
> you handle strings by reference and also have limited support for
> modifying strings in-place?Uppercase

One way to do it would be to create an upper case copy of the string, clear
the original string, then append the upper case string to the original:

  upper = Text.toUpper()
  Text.clear()
  Text.append(upper)

The Text object should be the same QString at the end of the method as the
one supplied as a parameter.

David


More information about the PyQt mailing list