![]() |
QT - My way to force numeric input
This is probably lame, but I thought I'd share my method for making a lineEdit into a numeric only input.
Code:
void MainWindow::on_lineEdit_textChanged(QString ) |
Re: QT - My way to force numeric input
set your code into the code-tag [.code] [./code] (of course without the . ) :)
|
Re: QT - My way to force numeric input
Quote:
|
Re: QT - My way to force numeric input
What about ze Germans with their QWERTZ keyboards? (Being qwerty12, I have to boo at the Germans for using the QWERTZ layout on their keyboards anyway, but... :p)
|
Re: QT - My way to force numeric input
I'd suggest looking at:
http://doc.trolltech.com/4.6/qwidget...thodHints-prop and http://doc.trolltech.com/4.6/qlineed...inputMask-prop and http://doc.trolltech.com/4.6/qlineed...l#setValidator Hope this helps. |
Re: QT - My way to force numeric input
Quote:
If you forget about the qwertyuiop to 1234567890 translation then the basic principle is sound! Just did the translation for lazy old me. Shep |
Re: QT - My way to force numeric input
Quote:
Thanks for the tips though |
Re: QT - My way to force numeric input
Quote:
|
All times are GMT. The time now is 12:19. |
vBulletin® Version 3.8.8