Shortcut QLineEdit
I need created shortcut grabber, such as used in Qt Creator keyboard mapping. Can any body tell, if something already exist in free use. Or point me where to find, source of Qt Creator shortcut edit class grab ?
4 replies
Create a class which inherits from QLineEdit.
And then , reimplement keyPressEvent()
This is a quick exemple !
- {
- }
- {
- QString grab;
- switch ( event->modifiers())
- {
- }
- grab.append(event->text());
- setText(grab);
- // QLineEdit::keyPressEvent(event);
- }
- {
- QString grab;
- int modifiers = event->modifiers();
- grab.append("Ctrl+");
- grab.append("Shift+");
- grab.append("Alt+");
- grab.append(event->key());
- setText(grab);
- // QLineEdit::keyPressEvent(event);
- }
Edit: please use @ tags around code sections; Andre
You must log in to post a reply. Not a member yet? Register here!


