Search code examples
qtqt4qtexteditqdialog

Pressing Tab in QTextEdit in Dialog - change behavior


I have QDialog that contains few buttons and a QTextEdit. after writing something in the QTextEdit, I press tab in order to get to one of the buttons, but when I pressing tab, a tab space is added to the QTextEdit. How can I change this behavior?


Solution

  • You can use setTabChangesFocus method of QTextEdit:

    yourTextEdit.setTabChangesFocus(true);