It's weired that the same code on another pc (same qt version, but win10x64 professional) works fine. as the widget recevied these keys, so it seems impossible that it's due to some global hot-keys.
At 2018-05-04 08:55:09, "nus1998" <[email protected]> wrote: 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
