I want to prohibit the focus from switching when I press Tab.

Asked 2 months ago, Updated 2 months ago, 3 views

Recently, I've been developing the text editor, but when the view is focused, pressing Tab moves the focus to another widget and I can't insert Tab characters.
There must have been a setting that prohibits focus movement through tabs, but I can't remember that.
I would appreciate it if you could tell me specifically how I can prohibit the movement of the focus using the tab key.

Development Environments: Windows 10, Visual Studio 2019, C++, Qt5.14

c++ qt qt5

2022-09-30 13:44

1 Answers

Reimplement bool focusNextPrevChild (bool next); in the view widget and
If you return false, focus movement is prohibited and keyPressEvent() appears to be called properly.


2022-09-30 13:44

If you have any answers or tips


© 2022 OneMinuteCode. All rights reserved.