Hi All,

I have some questions on keyPressEvent on sub-class of QPlainTextEdit, for the 
code attached below.
If I press '(', '{', or '[', these keys will be displayed in the edit. qDebug 
outputs 16777248  (value of Shift) for '(' and '{',  and outputs nothing for 
'['.
if I press any other key, they will be printed correctly and not displayed in 
the edit.

What's the problem for that?

my env: Qt 5.6.2 minGW version on win10 x64.

Best regards
Nus



#ifndefTESTEDIT_H
#defineTESTEDIT_H
#include<QPlainTextEdit>
#include<QKeyEvent>
#include<QDebug>


classTestEdit:publicQPlainTextEdit
{
Q_OBJECT
public:
TestEdit(){}
protected:
virtualvoidkeyPressEvent(QKeyEvent*e){qDebug()<<e->key();}
};


#endif//TESTEDIT_H

_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to