[PyQt] Uppercase QLineEdit

Mads Ipsen mpi at comxnet.dk
Mon Jan 25 16:48:44 GMT 2010


Hi,

I need to construct a QLineEdit that displays everything in upper-case. 
In native Qt this can be done via a QValidator using something along the 
lines

      pqUpcaseValidator::pqUpcaseValidator( QWidget* Parent, const char* 
Name )
      : QValidator( Parent, Name )
      {}

      QValidator::State pqUpcaseValidator::validate( QString& Text , 
int& Pos ) const
      {
      Text = Text.upper();
      return Acceptable;
      }

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

Any help/directions are welcome.

Best, Mads



-- 
+-------------------------------------------------------------+
| Mads Ipsen, Scientific developer                            |
+-------------------------------+-----------------------------+
| QuantumWise A/S               | phone:         +45-29716388 |
| Nørre Søgade 27A              | www:    www.quantumwise.com |
| DK-1370 Copenhagen K, Denmark | email:  mpi at quantumwise.com |
+-------------------------------+-----------------------------+




More information about the PyQt mailing list