1

I have a window with multiple line edit widgets, allowing the user to enter text in multiple input fields.

However when I run the application, the text cursor position defaults to the last input field, rather than the first field.

I would instead like the text cursor to default to the first widget upon opening the application, so that the user can immediately start typing into the first field without having to manually select that field.

I have specified the first widget as the first tab order, however does not seem to make a difference.

Is there an option in QT designer where I can specify the default widget for the cursor when opening the application?

1

1 Answer 1

1

Found it - I believe the function is called setFocus()

I added this to the widget which I wanted to have keyword cursor focus, and the keyboard cursor sucessfully defaulted to this widget upon opening the window.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.