5
votes

I have 2 TextEdit boxes and 5 buttons that are arranged in linear order.

  1. The focus should be on the first TextEdit box when the program is started.
  2. When tab key is pressed it should change the focus to the next widget.

Actually when a tab key is pressed the tab space is entered inside the TextEdit box. instead of moving to the next box. I also cannot use LineEdit Box because the input needs to be displayed in multiple lines. anyway the input wont contain enter key or '\n'

1

1 Answers

5
votes

To change the behaviour of tab key you should look here:

http://doc.qt.io/qt-5/qplaintextedit.html#tabChangesFocus-prop

bool  tabChangesFocus() const
void  setTabChangesFocus(bool b)