Re: Problems with QLineEdit
Don't use QLocale, simply
Code:
ui
->lineEditFlags
->setText
(QString::number(flags
));
is enough.
Re: Problems with QLineEdit
Quote:
Originally Posted by
RSX
The second problem is that:
Code:
ui->lineEditFlags->setValidator(validator);
It works fine until my program sets text to something like 1 048 576 (something that has whitespace). Then I can enter any character I want =/
you can also set a QLineEdit::inputMask.
Re: Problems with QLineEdit
Re: Problems with QLineEdit
Hi, I have the same problem:
I using QLineEdit and QRegExpValidator:
1) These code is working correctly
@lneLne1.setText("QWERTY1")
@lneLne1.setValidator(Qt::RegExpValidator.new(Qt:: RegExp.new('[\x0410- \x044F]*'), @lneLne1)). We set invalid string "QWERTY1" in lneLne1 and set after validator for russian character. Now we can't input(manually) any character because text in @lneLne1 is invalid.
But if we add string @lneLne1.setText("qWERTY") in the end, i.e. we have code:
@lneLne1.setText("QWERTY1")
@lneLne1.setValidator(Qt::RegExpValidator.new(Qt:: RegExp.new('[\x0410-\x044F]*'), @lneLne1))
@lneLne1.setText("qWERTY")
then validator is disabled!!!:(
(I can input any symbol in field). And i can't enable it again.
PS: I coding in RubyQt