S
S
StrangeDylan2021-07-20 14:15:17
Python
StrangeDylan, 2021-07-20 14:15:17

How to track enter presses in qtextedit?

It is necessary when you press enter and focus on the input field, some kind of action occurs, I did it through the eventFilter, but the text is entered very slowly.

def eventFilter(self, obj, event):
        if event.type() == QtCore.QEvent.Type.KeyPress:
            if event.key() == QtCore.Qt.Key.Key_Return:
                print('Enter pressed')
                return True
        return False

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kokapuk, 2021-07-20
@kokapuk

returnPressed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question