Search code examples
c++qtpasswordscapslock

Qt - Password field, warn about Caps-Lock


Is there any Qt-built-in method to warn user (with pop-up window) that CapsLock is switched on while password field is active?

I am currently using QLineEdit (is it good?) with setEchoMode(QLineEdit::Password).


Solution

  • I have soved this problem already. I have used QToolTip QT - How to apply a QToolTip on a QLineEdit as a way to inform user about caps lock stat, and used, of course, a function that gets current state ( GetKeyState(VK_CAPITAL)). Disadvantage: this works on Windows only.