PDA

View Full Version : LineEdit for Hexadecimal input



mastupristi
21st January 2010, 09:16
I need a LineEdit widget to edit a bytearray in hexadecimal format. Something like this:
http://img30.imageshack.us/img30/9683/lineedit.png (http://img30.imageshack.us/i/lineedit.png/)

I want that LineEdit could take only [0-9][a-f][A-F] characters, and spaces should be added by widget only for visualization needs.
value() method should return a bytearray (for the image example "\x1ahallo!!")

there exest something on the web already done?

thanks

vishwajeet.dusane
21st January 2010, 13:18
Hi

QLineEdit::setInputMask method you can use for hexadecimal inputs




setInputMask("HH HH HH HH HH HH ;")

mastupristi
21st January 2010, 14:51
QLineEdit::setInputMask method you can use for hexadecimal inputs
It works only for 50%
I need to edit a line arbitrarily long