[Qt-interest] Subclassing QLineEdit

A. S. Budden abudden at gmail.com
Thu Feb 18 18:33:09 CET 2010


On 18 February 2010 16:52, Alexandre Beraud <aberaud at infflux.com> wrote:
> Hi,
>
> Imho it would be better to subclass QValidator and set an instance of
> your validator to the QLineEdit through QLineEdit::setValidator(const
> QValidator *). Then reimplement the validate() method of QValidator.
> Since it takes as argument a reference to the string, you can modify
> this string inside this method and at the same time check whether the
> input string is correct or not.

Works like a charm: many thanks!

Al



More information about the Qt-interest-old mailing list