ALT+numpad entry for unicode characters not working with QLineEdit in Windows

  • Hello,

    This is my first post on the Qt Developer Network -- hopefully I'm in the correct forum. I've searched for existing information on this topic without any success.

    Essentially I have a QLineEdit widget in my UI. It will not accept ALT+numpad sequences for entering text characters by character code. For example, pressing ALT+1+2+3 should yield the '{' character (the 1+2+3 must be from the number pad on the keyboard).

    Strange thing is this works "preview" mode in Qt Designer. However on my Windows Qt application it does not. The code fails to deliver the '{' character. Instead it process the ALT and the 1, 2, 3, strokes separately and delivers nothing because this code in QLineControl::processKeyEvent() results in no action (t.IsEmpty() is true because t is ""):
    QString t = event->text();
    if (!t.isEmpty() && {
    I was hoping to find some code higher up in QLineControl::processKeyEvent() that would trap the ALT+numpad sequence but no luck. My other thought was maybe Windows would intercept the ALT+numpad sequence and just provide the singular character result (also not happening).

    I'm starting to think my only course is to create my own QLineEdit child class and override the ::event() method. This way I can trap the ALT modifier and handle the numpad sequence.

    Before I take that action, I want to check with the community in case I'm missing something simple that fixes my problem.

    Best Regards,


    I'm using QT 4.7.0 (open source) with Windows 7 x64

  • Some feedback that will help me:

    • Has anyone seen this problem?
    • Has anyone had success using ATL-numpad entry in a QLineEdit widget?

    If nobody has this problem and they can use the ALT-numpad entry, then that suggests a Qt configuration problem on my end.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.