Finally i think the reason is not my validator. I have try it with a QRegExpValidator and the same problem comes up. Here is a short example:
QRegExp rx
("^([0-5][,.][0-9]{0,2}|[0-6][,.][0]{0,2}|[0-6])$");
ui.
Box->lineEdit
()->setValidator
( new QRegExpValidator(rx, ui.
Box->lineEdit
() ) );
QRegExp rx("^([0-5][,.][0-9]{0,2}|[0-6][,.][0]{0,2}|[0-6])$");
ui.Box->lineEdit()->setValidator( new QRegExpValidator(rx, ui.Box->lineEdit() ) );
To copy to clipboard, switch view to plain text mode
Maybe it's important i use Qt 4.7.2
Added after 32 minutes:
I've found the reason for that problem. My QLineEdit contains only numbers and my QComboBox
alphanumeric characters. In this case works all fine:
ui.Box->addItem("0,50");
ui.Box->addItem("1,00");
ui.Box->addItem("1,50");
ui.Box->addItem("0,50");
ui.Box->addItem("1,00");
ui.Box->addItem("1,50");
To copy to clipboard, switch view to plain text mode
and that fails
ui.Box->addItem("0,50 Pieces");
ui.Box->addItem("1,00 Pieces");
ui.Box->addItem("1,50 Pieces");
ui.Box->addItem("0,50 Pieces");
ui.Box->addItem("1,00 Pieces");
ui.Box->addItem("1,50 Pieces");
To copy to clipboard, switch view to plain text mode
How can i add items like this and valitate right?
Bookmarks