1

i have a problem with QT Designer. I want to focus on specific tab in tabWidget with a button. You know.. i click one the for example button1 and tabs change. Anyone know how to do it? I also tryed ,after converting the ui file to .py, to do this in code but didn't work :(

1 Answer 1

1

You can use setCurrentIndex :

If you have a button you can connect the clicked signal to a function and call setCurrentIndex of tabwidget :

self.button = QtGui.QPushButton('Change Tab', self)
self.button.clicked.connect(self.handleButton)

def handleButton(self):
    tabwidget.setCurrentIndex(neededIndex)

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.