Qt - 密码字段,对Caps-Lock警告 [英] Qt - Password field, warn about Caps-Lock

查看:305
本文介绍了Qt - 密码字段,对Caps-Lock警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有任何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 http://stackoverflow.com/questions/ 3014879 / qt-how-to-apply-a-qtooltip-on-a-qlineedit 作为一种通知
用户关于大写锁定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 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.

这篇关于Qt - 密码字段,对Caps-Lock警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆