Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change focus between TextEdit boxes using tab key

Tags:

c++

qt

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'

like image 616
Abhay Jatin Doshi Avatar asked Nov 24 '16 13:11

Abhay Jatin Doshi


1 Answers

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)
like image 181
bibi Avatar answered Nov 15 '22 05:11

bibi