How to identify / select cascaded QTab(s) ?
-
Using QDesigner I have build "cascaded" QTabs - I have main / parent QTab and some of them contain another / child QTab(s) .
My task is to switch from main QTab page to selected child QTab page.
Main QTab contains other widgets, not just child QTab.
Iterating thru the main QTab is trivial, however, I am stumped on how to actually identify the widgets in child QTabs.In pseudocode
iterate all widgets in current page
does the widget == QTabWidget ?
yes - read the widget ( index, name etc.)See attached
// interate main tab for (int index = 0; index < ui->tabWidget->count(); index++) { // "parent " QTab ui->tabWidget->setCurrentIndex(index); ui->tabWidget->currentWidget(); // find child QTab in parent QTab page // iterate "child " QTabs for (int index = 0; index < widget ????->count(); index++) { .... is widget == QTabWidget ?? -
Using QDesigner I have build "cascaded" QTabs - I have main / parent QTab and some of them contain another / child QTab(s) .
My task is to switch from main QTab page to selected child QTab page.
Main QTab contains other widgets, not just child QTab.
Iterating thru the main QTab is trivial, however, I am stumped on how to actually identify the widgets in child QTabs.In pseudocode
iterate all widgets in current page
does the widget == QTabWidget ?
yes - read the widget ( index, name etc.)See attached
// interate main tab for (int index = 0; index < ui->tabWidget->count(); index++) { // "parent " QTab ui->tabWidget->setCurrentIndex(index); ui->tabWidget->currentWidget(); // find child QTab in parent QTab page // iterate "child " QTabs for (int index = 0; index < widget ????->count(); index++) { .... is widget == QTabWidget ??@AnneRanch said in How to identify / select cascaded QTab(s) ?:
ui->tabWidget->setCurrentIndex(index);
ui->tabWidget->currentWidget();Can be replaced by:
QWidget* widget=ui->tabWidget->widget(index);To find child tab you can use:
QTabWidget* child= widget->findChild<QTabWidget *>(); -
@AnneRanch said in How to identify / select cascaded QTab(s) ?:
ui->tabWidget->setCurrentIndex(index);
ui->tabWidget->currentWidget();Can be replaced by:
QWidget* widget=ui->tabWidget->widget(index);To find child tab you can use:
QTabWidget* child= widget->findChild<QTabWidget *>();@mpergand Thanks for reply. I got it all figured out.
SOLVED