问题描述
有没有任何Qt内置的方法警告用户(弹出窗口)CapsLock在密码字段活动时打开?
Is there any Qt-built-in method to warn user (with pop-up window) that CapsLock is switched on while password field is active?
我是目前使用 QLineEdit
(是好吗?) setEchoMode(QLineEdit :: Password)
。
I am currently using QLineEdit
(is it good?) with setEchoMode(QLine:Password)
.
推荐答案
我已经解决了这个问题。我已使用QToolTip 作为一种通知
用户关于大写锁定stat的方法,并且当然使用一个获取当前状态的函数(GetKeyState(VK_CAPITAL))。缺点:这只在Windows上工作。
I have soved this problem already. I have used QToolTip http://stackoverflow.com/questions/3014879/qt-how-to-apply-a-qtooltip-on-a-qlineedit as a way to informuser about caps lock stat, and used, of course, a function that gets current state ( GetKeyState(VK_CAPITAL)). Disadvantage: this works on Windows only.
这篇关于Qt - 密码字段,对Caps-Lock警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!