QTabWidget tab not showing up

1.5k views Asked by At

I am using multiple QTabWidgets tabs. I need the second tab to show up when a particular function is called.

The current tab page being 1, the tab page 2 should come up and tab page 1 should hide behind. I searched and tried a lot but with no avail.

I tried this too

ui->myTab->myTabPage2->show();

Used this in a function while the tab number 1 is showing visible and the tabPage2 being hidden.

1

There are 1 answers

1
Kirell On BEST ANSWER

I think you should use:

QTabWidget::setCurrentIndex(int tabnumber);

Or

QTabWidget::setCurrentWidget(QWidget* yourwidget);

Here is the doc: http://qt-project.org/doc/qt-5.0/qtwidgets/qtabwidget.html