I have implemented a custom QTextEdit class in which I am overiding the keyPressEvent method.
I want to check if the key that was pressed is among the following:
1. Capital alphabets
2. Lowercase alphabets
3. Space
If my function declaration is something like:
def keyPressEvent(self, event):
I could do something like:
if event.key() in (
QtCore.Qt.Key_A,
QtCore.Qt.Key_B,
QtCore.Qt.Key_C,
QtCore.Qt.Key_D,
....
....
And so on.
How would I loop through these values? And how will I access the actual character that is pressed? I want to create a string of the keys pressed as long as they are alphabets.