Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top