Why does Label::textEditorTextChanged() call textEditorReturnKeyPressed()?


#1

I’m sure there’s a good reason for this behavior, but I’m struggling to understand it…

Let’s say I have a Label that is focused and text is selected, ready to edit. If I click on a sibling component, I notice that the Label’s textEditorReturnKeyPressed() is called. This seems strange to me.

I would like to handle a click-away very differently than a return key press. But in my overridden textEditorReturnKeyPressed() how can I know the difference between an actual return key press and the user clicking away from the focused text field?

Edit: I should probably also mention that the reason for the textEditorTextChanged() call when clicking away is that Label::textEditorFocusLost() calls it.


#2

I see now that Label::textEditorTextChanged() has comments in the declaration indicating that it is internal, so perhaps my mistake is trying to override this in the first place.