Important: Please read the Qt Code of Conduct -

[Solved] QLineEdit input incorrectly uppercased

  • Hi,

    I'm relatively new to the Qt Library, but I've come to really like it for its simplicity and usefulness.

    The problem I'm having is that the input I type into QLineEdit at runtime is all uppercased.

    Things I've excluded to be the problem:

    • I have no QValidator working on the input, so the input isn't changed
    • There are no Input Method Hints active (although that wouldn't change the input I think)
    • Caps lock is off, input works fine in other applications
    • I even tried changing the font to AllLowercase & MixedCase; AllLowercase displays the text in all lower case,
      and MixedCase doesn't change it. But both don't change the actual input QString (and I don't want all lower case anyway).
    • Setting the text using setText does work correctly (the characters don't get uppercased this way)

    I'm working with Qt Version 4.8.0 integrated into my VS project, which is a normal Win32 App. I'm making
    my UI's using Qt Designer and I'm importing the generated header files into my project.

    Does anyone here have any clue as to what might be going wrong? Is there come global setting somewhere that
    can affect the input typed into the application? (it happens to all my QLineEdits' input)


  • welcome to devnet

    That is quite an interesting issue. Can you provide a small compilable example showing the problem?

  • It appears I've found the problem already (sorry for taking your time).

    I'm running an OpenGL Render window at the same time, isolated from the QApplication.
    So when I implemented my Qt Application on top of my current framework, it ran
    fine (apart from the input characters being uppercased), even when I didn't call
    QApplication::exec. Not calling exec would normally keep the Qt Window from updating.
    Calling exec (which I obviously should have done from the start) fixed the problem.

    The weirdest part is that because of my OpenGL window frame updates,
    the QApplication mainwindow also got updated without calling exec
    (which hid the problem), BUT with the input always being uppercased.

  • No problem. I am glad that you have solved your problem.
    I have wondered what that could be. However, by asking for a small compilable example, I have expected already that you will find somehow your issue. That happens to most developers and for sure it had heppened to me as well. So, do not worry.

    You might want to mark your post with [Solved] in the title line.

Log in to reply