I have a form designed in Qt Designer (with PyQt5). I use a line-edit there for entering some input. What I want is to add the ability to use a keyboard combo (something like Ctrl+B or one of the function keys) in the line-edit. Once that combo or function key is pressed, I am going to run a function/method that will paste the clipboard contents in a "special" way (meaning it will filter and adjust the value from the clipboard).
It seems all easy, and a lot of people must have been doing this kind of stuff before. But I wasn't able to find a single, simple, understandable way of doing what I want. Here is the kind of solution I am looking for. The following is under a class that holds the MainForm code:
self.ui.my_lineedit.keyboard_key_pressed.connect(self.my_func, ctrl+b)
def my_func(self):
pass
I made up the keyboard_key_pressed
part (and others) for you to understand what I'm going for. Is there a straightforward way of doing what I want like the example above?