解决qt输入法 qinputcontent 在qdialog下没响应的问题
来源:互联网 发布:什么软件看漫画免费 编辑:程序博客网 时间:2024/05/16 06:44
使用qinputcontent的方式实现的qt输入法,在qdialog下不能正常操作,好像输入法死掉一样,根据下面这边帖子解决问题,感谢分享。
http://www.qtcn.org/bbs/read-htm-tid-45344.html
主要是下面的方法:
经过测试,点击输入面板,没有发应的问题,是由QDialog.exec()引起的~~
故切入点还是它。看QT帮助手册:
int QDialog::exec() [slot]
Shows the dialog as a modal dialog, blocking until the user closes it .The function returns a DialogCode result.
if the dialog is application modal,users cannot interact with any other window in the same applicatio until they close the dialog. if the dialog iswindow modal,only interaction with the parent window is blocked while the dialog is open.By default, the dialog is application modal.
See also open() ,show(),result(),and setWindowModality().
从上面,可以看出QDialog默认为application modal,而要使用输入法,必有“interaction with the parent window is blocked while the dialog is open”,故使用setWindowModality(Qt::WindowModal),就可以使用输入法了。
故原来的代码改为:
........
SecondDialog seconddialog;
seconddialog.setWindowModality(Qt::WindowModal);
seccondialog.exec();
0 0
- 解决qt输入法 qinputcontent 在qdialog下没响应的问题
- 解决QT在VS下中文乱码的问题
- 解决oninput事件在中文输入法下会取得拼音的值的问题
- 在Ubuntu 下安装Google拼音输入法和解决输入法无法打印中文的问题
- 解决EditText在输入状态下点击其他区域隐藏输入法的问题
- 解决Struts2在继承默认包struts-default没联网状态下的警告问题
- 解决没在写保护情况下adb中一直卸载不了app的问题
- oracle9i 在solaris下用dbca创建第二个数据库的时候 直接没响应 是什么原因 各位高手们帮忙解决下
- 解决vue在ios端下点击响应延时问题
- QT:QDialog的设置简述
- ubuntu下中文问题的解决:输入法、乱码
- ubuntu下中文问题的解决:输入法、乱码
- 解决字符终端下fbterm打不开yong输入法的问题
- fedora14下安装fcitx输入法 以及一些问题的解决
- 解决Linux下 sublime text2输入法问题的方案
- fcitx输入法在wps、wineqq中失灵问题的解决
- fcitx输入法在wps、wineqq中失灵问题的解决
- 解决在IIS中点击浏览没反应的问题
- Codeforces Beta Round #57 (Div. 2) E. Enemy is weak
- 娓娓道来c指针 (0)c语言的梦魇:c指针
- HDU 1021 Fibonacci Again
- 一张图告诉你HTML 5 的历史
- [hihocoder 1033]交错和 数位dp/记忆化搜索
- 解决qt输入法 qinputcontent 在qdialog下没响应的问题
- Dp_F Pku1157
- 关于在dll中申请内存,外部释放的问题
- python错误 ImportError: No module named setuptools 解决方法
- Java内存区域
- 5-1. 约分最简分式(15)
- 诗意行走
- 动态设置控件大小位置
- Red and Black