开发者

how to get the focus of MyLinedit?

I am new to Qt application development. In my Application i have built a QWERTY keypad usign QSignalMapper.I have 3 QLineEdit boxes above this keypad area. Now, when ever i select any line, i didnt get to know which line object gets selected.

If i subclass QLineEdit, and Reimplement this, than also i am not knowing which particular line has the current focus.If i presses line edit box, and start typing into that with keypad, focus moves to keypad's button.

Than,how can i 开发者_开发技巧get to know which line edit has been selected?


You can override QLineEdit::focusInEvent in order to remember which line edit was last focused.


You can set your keypad buttons to never accept focus. This way, the focus won't leave the line edit when keypad buttons are pressed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜